v7.2@uwuzu1.5.4をリリース

This commit is contained in:
2025-08-02 19:39:50 +09:00
parent f6f7030d8c
commit 718e97ed45
14 changed files with 215 additions and 47 deletions
+16 -10
View File
@@ -1,35 +1,41 @@
import * as fs from "fs";
import config from "../config.js";
import { readFileSync, writeFileSync, existsSync } from "fs";
export default async function VersionCheck() {
const nowVersion: string = JSON.parse(fs.readFileSync("package.json", "utf-8")).version;
const packageJson = JSON.parse(readFileSync("package.json", "utf-8"));
// 初期化
if (!fs.existsSync("logs/version.txt")) {
fs.writeFileSync(
if (!existsSync("logs/version.txt")) {
writeFileSync(
"logs/version.txt",
nowVersion,
packageJson.version,
"utf-8",
);
}
// 最終起動バージョン取得
const oldVersion = fs.readFileSync("logs/version.txt", "utf-8");
const oldVersion = readFileSync("logs/version.txt", "utf-8");
if (oldVersion !== nowVersion) {
if (oldVersion !== packageJson.version) {
try {
fs.writeFileSync(
writeFileSync(
"logs/version.txt",
nowVersion,
packageJson.version,
"utf-8",
);
const releaseUrl = `${packageJson.repository.url}/releases/tag/${packageJson.tag}`;
await fetch(`https://${config.uwuzu.host}/api/ueuse/create`, {
method: "POST",
body: JSON.stringify({
token: config.uwuzu.apiToken,
text: `${nowVersion}にBOTがアップデートされました!`,
text: `
${packageJson.version}にBOTがアップデートされました!
リリース内容:${releaseUrl}
`,
}),
cache: "no-store",
});
} catch (err) {
console.log("アップデート通知にエラーが発生しました: ", err);