v25.8.10
This commit is contained in:
@@ -32,26 +32,34 @@ export default async function MiQAllow(data: ueuse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmUeuse: ueuse = (await (
|
||||
await fetch(`${config.uwuzu.host}/api/ueuse/get`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken,
|
||||
uniqid: data.replyid,
|
||||
}),
|
||||
})
|
||||
).json())["0"];
|
||||
const confirmUeuseReq = await fetch(`${config.uwuzu.host}/api/ueuse/get`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken,
|
||||
uniqid: data.replyid,
|
||||
}),
|
||||
});
|
||||
|
||||
const me: meApi = await (
|
||||
await fetch(`${config.uwuzu.host}/api/me/`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken
|
||||
}),
|
||||
})
|
||||
).json()
|
||||
if (confirmUeuseReq.status < 200 || confirmUeuseReq.status > 299) {
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmUeuse: ueuse = (await confirmUeuseReq.json())["0"];
|
||||
|
||||
const meReq = await fetch(`${config.uwuzu.host}/api/me/`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken
|
||||
}),
|
||||
});
|
||||
|
||||
if (meReq.status < 200 || meReq.status > 299) {
|
||||
return;
|
||||
}
|
||||
|
||||
const me: meApi = await meReq.json()
|
||||
|
||||
if (confirmUeuse.account.userid !== me.userid) {
|
||||
console.log("MiQ許可制(誤アカウント):", await Reply(`
|
||||
@@ -67,16 +75,20 @@ export default async function MiQAllow(data: ueuse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const requestUeuse: ueuse = (await (
|
||||
await fetch(`${config.uwuzu.host}/api/ueuse/get`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken,
|
||||
uniqid: confirmUeuse.replyid,
|
||||
}),
|
||||
})
|
||||
).json())["0"];
|
||||
const requestUeuseReq = await fetch(`${config.uwuzu.host}/api/ueuse/get`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken,
|
||||
uniqid: confirmUeuse.replyid,
|
||||
}),
|
||||
});
|
||||
|
||||
if (requestUeuseReq.status < 200 || requestUeuseReq.status > 299) {
|
||||
return;
|
||||
}
|
||||
|
||||
const requestUeuse: ueuse = (await requestUeuseReq.json())["0"];
|
||||
|
||||
if (requestUeuse.replyid === "") {
|
||||
console.log("MiQ許可制(誤ユーズ):", await Reply(`
|
||||
@@ -85,16 +97,20 @@ export default async function MiQAllow(data: ueuse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const miqUeuse: ueuse = (await (
|
||||
await fetch(`${config.uwuzu.host}/api/ueuse/get`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken,
|
||||
uniqid: requestUeuse.replyid,
|
||||
}),
|
||||
})
|
||||
).json())["0"];
|
||||
const miqUeuseReq = await fetch(`${config.uwuzu.host}/api/ueuse/get`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken,
|
||||
uniqid: requestUeuse.replyid,
|
||||
}),
|
||||
});
|
||||
|
||||
if (miqUeuseReq.status < 200 || miqUeuseReq.status > 299) {
|
||||
return;
|
||||
}
|
||||
|
||||
const miqUeuse: ueuse = (await miqUeuseReq.json())["0"];
|
||||
|
||||
let color: boolean;
|
||||
let msg: string;
|
||||
@@ -130,6 +146,10 @@ export default async function MiQAllow(data: ueuse) {
|
||||
cache: "no-store",
|
||||
});
|
||||
|
||||
if (req.status < 200 || req.status > 299) {
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await req.json();
|
||||
|
||||
console.log("MiQ(許可制):", res);
|
||||
|
||||
@@ -28,16 +28,20 @@ export default async function MakeItAQuote(data: ueuse) {
|
||||
color = false;
|
||||
}
|
||||
|
||||
const ueuseData: ueuse = (await (
|
||||
await fetch(`${config.uwuzu.host}/api/ueuse/get`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken,
|
||||
uniqid: data.replyid,
|
||||
}),
|
||||
})
|
||||
).json())["0"];
|
||||
const ueuseDataReq = await fetch(`${config.uwuzu.host}/api/ueuse/get`, {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: config.uwuzu.apiToken,
|
||||
uniqid: data.replyid,
|
||||
}),
|
||||
});
|
||||
|
||||
if (ueuseDataReq.status < 200 || ueuseDataReq.status > 299) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ueuseData: ueuse = (await ueuseDataReq.json())["0"];
|
||||
|
||||
console.log(ueuseData);
|
||||
|
||||
@@ -96,6 +100,10 @@ export default async function MakeItAQuote(data: ueuse) {
|
||||
cache: "no-store",
|
||||
});
|
||||
|
||||
if (req.status < 200 || req.status > 299) {
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await req.json();
|
||||
|
||||
console.log("MiQ:", res);
|
||||
|
||||
@@ -72,6 +72,7 @@ export default async function MiQPermission(data: ueuse) {
|
||||
JSON.stringify(permissions),
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
await Reply(`
|
||||
あなたに対してのMake it a Quoteを生成するための権限を「${PermissionsNames[requestPermission]}」に変更しました。
|
||||
`, data.uniqid);
|
||||
|
||||
Reference in New Issue
Block a user