Chg: pnpm 11.1.3 / Del: helpコマンドとmiqコマンドを除く全てのi18n / Feat: 朝四時に何してるんだい?
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { createUeuse } from "@/lib/client";
|
||||
import { format } from "date-fns";
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
console.log("時報の投稿を行います");
|
||||
|
||||
try {
|
||||
if (new Date().getHours() !== 4) {
|
||||
await createUeuse({
|
||||
text: `${format(new Date(), "H:mm")}になりました。`,
|
||||
}, "時報");
|
||||
} else {
|
||||
const asayoziImg = readFileSync(`${import.meta.dirname}/asayozi.png`);
|
||||
await createUeuse({
|
||||
text: "朝四時に何してるんだい?",
|
||||
media: {
|
||||
photo: [asayoziImg.toString("base64")],
|
||||
},
|
||||
}, "時報(午前4時)");
|
||||
}
|
||||
|
||||
process.exit(0);
|
||||
} catch (err: any) {
|
||||
console.error("message" in err
|
||||
? err.message
|
||||
: err);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user