add an option to disable daytime announcements
This commit is contained in:
parent
a22c792358
commit
01f752660b
6
index.js
6
index.js
|
@ -1,5 +1,5 @@
|
||||||
const Discord = require('discord.js');
|
const Discord = require('discord.js');
|
||||||
const {token} = require('./config.json');
|
const { token, disableDaytimeAnnouncements } = require('./config.json');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ bot.on('ready', () => {
|
||||||
|
|
||||||
// console.log(current, next.morning, next.night);
|
// console.log(current, next.morning, next.night);
|
||||||
|
|
||||||
if (current > next.morning) {
|
if (current > next.morning && !disableDaytimeAnnouncements) {
|
||||||
next.morning = getNextMorning();
|
next.morning = getNextMorning();
|
||||||
channels.forEach(c => {
|
channels.forEach(c => {
|
||||||
bot.channels.fetch(c)
|
bot.channels.fetch(c)
|
||||||
|
@ -97,7 +97,7 @@ bot.on('ready', () => {
|
||||||
});
|
});
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
if (current > next.night) {
|
if (current > next.night && !disableDaytimeAnnouncements) {
|
||||||
next.night = getNextNight();
|
next.night = getNextNight();
|
||||||
channels.forEach(c => {
|
channels.forEach(c => {
|
||||||
bot.channels.fetch(c)
|
bot.channels.fetch(c)
|
||||||
|
|
Loading…
Reference in New Issue