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
+4 -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";
@@ -10,16 +10,11 @@ parentPort?.on("message", async () => {
console.log("新年迎春の投稿を行います");
try {
const response = await client.request("ueuse/create", {
await createUeuse({
text: i18next.t("hnyNotice", { year: String(new Date().getFullYear()) }),
});
}, "新年迎春");
if (!response.success) {
console.warn("新年迎春投稿に失敗しました:", response.error_code);
process.exit(1);
}
console.log("新年迎春投稿:", `${response.uniqid} (${format(new Date(), "yyyy/M/d H:mm:ss:SSS")})`);
console.log("新年迎春投稿時刻:", format(new Date(), "yyyy/M/d H:mm:ss:SSS"));
process.exit(0);
} catch (err: any) {
console.error("message" in err