aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIndrajith K L2021-06-22 22:24:42 +0530
committerIndrajith K L2021-06-22 22:24:42 +0530
commite3019705453d6afb1199c10f803e05f189512934 (patch)
tree78cbf306e43f3f5c6046ce5f3d875792b9aa55f8 /src
parentbd1d07a387f28cc268266353db964ca8baf96e6d (diff)
downloadradio-bot-e3019705453d6afb1199c10f803e05f189512934.tar.gz
radio-bot-e3019705453d6afb1199c10f803e05f189512934.tar.bz2
radio-bot-e3019705453d6afb1199c10f803e05f189512934.zip
Renames Command ```tune``` to ```fm```
Adds Presense of BOT with current radio station
Diffstat (limited to 'src')
-rw-r--r--src/commands/tune.js5
-rw-r--r--src/configs/commands.config.json2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/tune.js b/src/commands/tune.js
index e00b50d..3c78474 100644
--- a/src/commands/tune.js
+++ b/src/commands/tune.js
@@ -6,14 +6,14 @@ let radioIndex = 0;
async function broadcastRadio(client, args, message, voiceChannel, textChannel) {
const connection = await voiceChannel.join();
try {
- playRadio(connection, textChannel, args);
+ playRadio(connection, textChannel, args, client);
} catch (error) {
console.log(error);
textChannel.send('Something went wrong. RADIO MON got ill...😱😱');
}
}
-async function playRadio(connection, textChannel, args) {
+async function playRadio(connection, textChannel, args, client) {
try {
const [radioCommand] = args;
const radioConfig = await readFile('src/configs/radio.json', 'utf8');
@@ -43,6 +43,7 @@ async function playRadio(connection, textChannel, args) {
.setDescription(currentRadioStation.name)
.setColor('LUMINOUS_VIVID_PINK');
textChannel.send(nowPlayingMessage)
+ client.user.setPresence({ activity: { name: `${currentRadioStation.name}`, type: 'LISTENING' } });
} catch (error) {
console.log(error);
};
diff --git a/src/configs/commands.config.json b/src/configs/commands.config.json
index 9ef5a75..8e3cd67 100644
--- a/src/configs/commands.config.json
+++ b/src/configs/commands.config.json
@@ -11,7 +11,7 @@
"file": "./commands/radioStop.js"
},
{
- "name": "tune",
+ "name": "fm",
"description": "FM Radio Tune IN",
"file": "./commands/tune.js"
}