Feat: ユーズの再試行 / Feat: ユーズの文字数制限回避 / Feat: ユーズ送信関数 / Chg: weatherNotice.tsのマジックナンバーに命名

This commit is contained in:
2026-05-03 13:50:11 +09:00
parent 74c1552472
commit d429503b78
12 changed files with 201 additions and 297 deletions
+3 -9
View File
@@ -1,4 +1,4 @@
import client from "@/lib/client";
import { createUeuse } from "@/lib/client";
import initI18n from "@/lib/i18n";
import { format } from "date-fns";
import i18next from "i18next";
@@ -7,16 +7,10 @@ await initI18n();
console.log("時報の投稿を行います");
try {
const response = await client.request("ueuse/create", {
await createUeuse({
text: i18next.t("timeNotice", { time: format(new Date(), "H:mm") }),
});
}, "時報");
if (!response.success) {
console.warn("時報投稿に失敗しました:", response.error_code);
process.exit(1);
}
console.log("時報投稿:", response.uniqid);
process.exit(0);
} catch (err: any) {
console.error("message" in err