Feat: ユーズの再試行 / Feat: ユーズの文字数制限回避 / Feat: ユーズ送信関数 / Chg: weatherNotice.tsのマジックナンバーに命名
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import client from "@/lib/client";
|
||||
import { createUeuse } 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";
|
||||
@@ -14,31 +14,19 @@ const helps = [
|
||||
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", {
|
||||
await createUeuse({
|
||||
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", {
|
||||
await createUeuse({
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -52,15 +40,8 @@ export default async function helpCommand(ueuse: ueuseModule, args: string[]) {
|
||||
summarys += `${i18next.t(`help${help.charAt(0).toUpperCase()}${help.slice(1)}`)}${EOL}`;
|
||||
}
|
||||
|
||||
const response = await client.request("ueuse/create", {
|
||||
await createUeuse({
|
||||
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