Compare commits

..

1 Commits

2 changed files with 18 additions and 20 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "noticeuwuzu", "name": "noticeuwuzu",
"version": "v4.3.2@uwuzu1.5.4", "version": "v4.3.3@uwuzu1.5.4",
"description": "uwuzu Notice Bot", "description": "uwuzu Notice Bot",
"main": "dist/main.js", "main": "dist/main.js",
"scripts": { "scripts": {
+17 -19
View File
@@ -3,28 +3,26 @@ import { format } from "date-fns";
import type * as types from "types/types"; import type * as types from "types/types";
import config from "../config.js"; 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() { export default async function timeNotice() {
console.log("----------------"); 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) { if (inRange) {
console.log("時報休止期間のため投稿されませんでした"); console.log("時報休止期間のため投稿されませんでした");
return; return;