From 354a658cc3ec8c8c15232c70eb348a9bc73f95a0 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 20 Jul 2020 20:17:40 -0400 Subject: Made the status channel customizable --- README.md | 3 ++- bot.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af39e22..d39ebaa 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ Make a new file called `config.json` "token": "token_here", "prefix": "!", "voiceChannel": "voice_channel_id", - "botOwner": "your_user_id_here" + "botOwner": "your_user_id_here", + "statusChannel": "channel_id" } ``` diff --git a/bot.js b/bot.js index b8c07af..cb458c4 100644 --- a/bot.js +++ b/bot.js @@ -34,8 +34,9 @@ function playAudio() { dispatcher.on('start', () => { console.log('Now playing ' + audio); - let serviceChannel = client.channels.cache.get('606602551634296968'); - serviceChannel.send('**Project Jul-2020 Bot:**\nNow playing ' + audio); + let statusChannel = client.channels.cache.get(config.statusChannel); + if (!statusChannel) return console.error('The channel does not exist!'); + statusChannel.send('**Project Jul-2020 Bot:**\nNow playing ' + audio); }); dispatcher.on('error', console.error); -- cgit v1.2.3