add an option to disable daytime announcements

This commit is contained in:
Jill 2022-06-08 02:33:31 +03:00
parent a22c792358
commit 01f752660b
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
const Discord = require('discord.js');
const {token} = require('./config.json');
const { token, disableDaytimeAnnouncements } = require('./config.json');
const fs = require('fs');
const path = require('path');
@ -88,7 +88,7 @@ bot.on('ready', () => {
// console.log(current, next.morning, next.night);
if (current > next.morning) {
if (current > next.morning && !disableDaytimeAnnouncements) {
next.morning = getNextMorning();
channels.forEach(c => {
bot.channels.fetch(c)
@ -97,7 +97,7 @@ bot.on('ready', () => {
});
save();
}
if (current > next.night) {
if (current > next.night && !disableDaytimeAnnouncements) {
next.night = getNextNight();
channels.forEach(c => {
bot.channels.fetch(c)