noticeUwuzu/scripts/commands/help.ts

29 lines
1000 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ueuse } from "types/types.js";
import { readFileSync } from "fs";
import { Reply } from "./main.js";
const helps = {
"info": "このBOTについての概要を返信するコマンドです。",
"help": "このコマンドです。コマンドの概要を返信します。",
"follow": "コマンド送信者をフォローします。",
"unfollow": "コマンド送信者をフォロー解除します。",
"weather": "天気を返信します。7:00に投稿されるものとは異なり再取得します。",
} as { [key: string]: string };
export default async function Help(data: ueuse) {
const packageJson = JSON.parse(readFileSync("package.json", "utf-8"));
const helpMsg =
Object.entries(helps)
.map(([command, message]) =>
`\`/${command}\`${message}`
).join('\n');
const ueuse = await Reply(`
${helpMsg}
機能を見る:${packageJson.repository.url}/wiki
`, data.uniqid);
console.log("ヘルプ:", ueuse);
}