16 lines
457 B
TypeScript
16 lines
457 B
TypeScript
import client from "@/lib/client";
|
|
import { format } from "date-fns";
|
|
import i18next from "i18next";
|
|
|
|
export default async function timeNotice() {
|
|
const response = await client.request("ueuse/create", {
|
|
text: i18next.t("timeNotice", { time: format(new Date(), "HH:mm") }),
|
|
});
|
|
|
|
if (!response.success) {
|
|
console.warn("時報投稿に失敗しました:", response.error_code);
|
|
return;
|
|
}
|
|
|
|
console.log("時報投稿:", response.uniqid);
|
|
} |