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 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
|
||||
|
||||
Reference in New Issue
Block a user