From 05194ad7b8b5b9c246506e79d713a274c8531b1a Mon Sep 17 00:00:00 2001 From: Last2014 Date: Sun, 6 Jul 2025 08:53:02 +0900 Subject: [PATCH] =?UTF-8?q?=E5=81=9C=E6=AD=A2=E6=99=82=E9=96=93=E3=81=AEBo?= =?UTF-8?q?olean=E3=82=92=E4=BD=BF=E3=81=84=E3=81=BE=E3=82=8F=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3(v4.3.3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- scripts/timeNotice.ts | 36 +++++++++++++++++------------------- 2 files changed, 18 insertions(+), 20 deletions(-) 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;