停止時間のBooleanを使いまわしている問題を修正(v4.3.3)
This commit is contained in:
parent
ef374b1639
commit
05194ad7b8
|
@ -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": {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue