Renames Command ``tune` to `fm``
Adds Presense of BOT with current radio station
This commit is contained in:
@@ -6,14 +6,14 @@ let radioIndex = 0;
|
|||||||
async function broadcastRadio(client, args, message, voiceChannel, textChannel) {
|
async function broadcastRadio(client, args, message, voiceChannel, textChannel) {
|
||||||
const connection = await voiceChannel.join();
|
const connection = await voiceChannel.join();
|
||||||
try {
|
try {
|
||||||
playRadio(connection, textChannel, args);
|
playRadio(connection, textChannel, args, client);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
textChannel.send('Something went wrong. RADIO MON got ill...😱😱');
|
textChannel.send('Something went wrong. RADIO MON got ill...😱😱');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function playRadio(connection, textChannel, args) {
|
async function playRadio(connection, textChannel, args, client) {
|
||||||
try {
|
try {
|
||||||
const [radioCommand] = args;
|
const [radioCommand] = args;
|
||||||
const radioConfig = await readFile('src/configs/radio.json', 'utf8');
|
const radioConfig = await readFile('src/configs/radio.json', 'utf8');
|
||||||
@@ -43,6 +43,7 @@ async function playRadio(connection, textChannel, args) {
|
|||||||
.setDescription(currentRadioStation.name)
|
.setDescription(currentRadioStation.name)
|
||||||
.setColor('LUMINOUS_VIVID_PINK');
|
.setColor('LUMINOUS_VIVID_PINK');
|
||||||
textChannel.send(nowPlayingMessage)
|
textChannel.send(nowPlayingMessage)
|
||||||
|
client.user.setPresence({ activity: { name: `${currentRadioStation.name}`, type: 'LISTENING' } });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"file": "./commands/radioStop.js"
|
"file": "./commands/radioStop.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tune",
|
"name": "fm",
|
||||||
"description": "FM Radio Tune IN",
|
"description": "FM Radio Tune IN",
|
||||||
"file": "./commands/tune.js"
|
"file": "./commands/tune.js"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user