noticeUwuzu/scripts/commands/info.ts

63 lines
1.7 KiB
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";
import config from "../../config.js";
export default async function Info(data: ueuse) {
const packageJson = JSON.parse(readFileSync("package.json", "utf-8"));
const releaseUrl = `${packageJson.repository.url}/releases/tag/${packageJson.tag}`;
let editor = "";
if (packageJson.author.name !== "Last2014") {
editor = `\nEdited by ${packageJson.author.name}`;
}
let adminMail;
if (config.admin.showMail === false) {
adminMail = "非公開";
} else {
adminMail = config.admin.showMail;
}
let isReport;
if (config.emergency.report) {
isReport = "有効";
} else {
isReport = "無効";
}
const ueuse = await Reply(`
【BOTについて】
このBOTはオープンソースソフトウェアであるnoticeUwuzuを利用して運営されています。
noticeUwuzuはApache License 2.0によって保護されています。
ライセンスに違反して使用した場合は著作権法違反となります。
バージョン:${packageJson.version}
リリース詳細:${releaseUrl}
【運営者情報】
運営者名:${config.admin.name}
メールアドレス:${adminMail}
報告機能(\`/report\`)${isReport}
【関連コマンド】
コマンドのヘルプをお探しですか?
\`/help\`をご利用ください。
運営者へ報告が必要ですか?
\`/report\`をご利用ください。
プライバシーポリシーをお探しですか?
\`/legal privacy\`をご利用ください。
【クレジット】
Created by Last2014${editor}
`, data.uniqid);
console.log("概要:", ueuse);
}