diff --git a/package.json b/package.json index 28333d9..61476ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "noticeuwuzu", - "version": "v4.3.2@uwuzu1.5.4", + "version": "v4.3.3@uwuzu1.5.4", "description": "uwuzu Notice Bot", "main": "dist/main.js", "scripts": { diff --git a/scripts/timeNotice.ts b/scripts/timeNotice.ts index 1fc674c..b15a8a6 100644 --- a/scripts/timeNotice.ts +++ b/scripts/timeNotice.ts @@ -3,28 +3,26 @@ import { format } from "date-fns"; import type * as types from "types/types"; import config from "../config.js"; - -// 停止時間 -// 時刻取得 -const start = config.time.stopTimes.start; -const stop = config.time.stopTimes.stop; - -// 現在の時間を取得 -const nowHour = new Date().getHours(); - -// 停止時刻内かどうかの判定 -let inRange: boolean = false; - -if (start < stop) { - inRange = nowHour >= start && nowHour < stop; -} else { - inRange = nowHour >= start || nowHour < stop; -} - - export default async function timeNotice() { console.log("----------------"); + // 停止時間 + // 時刻取得 + const start = config.time.stopTimes.start; + const stop = config.time.stopTimes.stop; + + // 現在の時間を取得 + const nowHour = new Date().getHours(); + + // 停止時刻内かどうかの判定 + let inRange: boolean = false; + + if (start < stop) { + inRange = nowHour >= start && nowHour < stop; + } else { + inRange = nowHour >= start || nowHour < stop; + } + if (inRange) { console.log("時報休止期間のため投稿されませんでした"); return;