2026.4.0-alpha.0
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
import client from "@/lib/client";
|
||||
import ueuseModule from "better-uwuzu-sdk/types/1.6.8/types/modules/ueuse";
|
||||
import i18next from "i18next";
|
||||
import { EOL } from "node:os";
|
||||
|
||||
const helps = [
|
||||
"help",
|
||||
"follow",
|
||||
"unfollow",
|
||||
"weather",
|
||||
"miq",
|
||||
];
|
||||
|
||||
export default async function helpCommand(ueuse: ueuseModule, args: string[]) {
|
||||
if (args[1] !== undefined) {
|
||||
if (!(helps.includes(args[1]))) {
|
||||
const response = await client.request("ueuse/create", {
|
||||
text: i18next.t("invalidOption", { option: args[1], command: "help" }),
|
||||
replyid: ueuse.uniqid,
|
||||
});
|
||||
|
||||
if (!response.success) {
|
||||
console.warn("コマンド詳細の返信に失敗:", response.error_code);
|
||||
return;
|
||||
}
|
||||
|
||||
console.warn("コマンド詳細:", response.uniqid);
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await client.request("ueuse/create", {
|
||||
text: i18next.t(`fullHelp${args[1].charAt(0).toUpperCase()}${args[1].slice(1)}`),
|
||||
replyid: ueuse.uniqid,
|
||||
});
|
||||
|
||||
if (!response.success) {
|
||||
console.warn("コマンド詳細の返信に失敗:", response.error_code);
|
||||
return;
|
||||
}
|
||||
|
||||
console.warn("コマンド詳細:", response.uniqid);
|
||||
return;
|
||||
}
|
||||
|
||||
let summarys = "";
|
||||
|
||||
for (let i = 0; i < helps.length; i++) {
|
||||
const help = helps[i];
|
||||
if (!help)
|
||||
break;
|
||||
|
||||
summarys += `${i18next.t(`help${help.charAt(0).toUpperCase()}${help.slice(1)}`)}${EOL}`;
|
||||
}
|
||||
|
||||
const response = await client.request("ueuse/create", {
|
||||
text: summarys.trim(),
|
||||
replyid: ueuse.uniqid,
|
||||
});
|
||||
|
||||
if (!response.success) {
|
||||
console.warn("コマンド概要の返信に失敗:", response.error_code);
|
||||
return;
|
||||
}
|
||||
|
||||
console.warn("コマンド概要:", response.uniqid);
|
||||
}
|
||||
Reference in New Issue
Block a user