mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 08:23:37 +00:00
All messages reworked
This commit is contained in:
@ -7,7 +7,7 @@ module.exports = {
|
||||
category: 'music',
|
||||
async execute(msg, args, client, Discord, prefix) {
|
||||
const radio = client.radio.get(msg.guild.id);
|
||||
if (!radio || !radio.playing) return msg.channel.send('<:redx:674263474704220182> There is nothing playing.');
|
||||
if (!radio || !radio.playing) return msg.channel.send('There is nothing playing.');
|
||||
radio.time = radio.connection.dispatcher.streamTime;
|
||||
const completed = (radio.time.toFixed(0));
|
||||
|
||||
|
@ -10,17 +10,17 @@ module.exports = {
|
||||
const radio = client.radio.get(msg.guild.id);
|
||||
const voiceChannel = msg.member.voice.channel;
|
||||
if (!radio) {
|
||||
if (!msg.member.voice.channel) return msg.channel.send('<:redx:674263474704220182> I\'m sorry but you need to be in a voice channel to play music!');
|
||||
if (!msg.member.voice.channel) return msg.channel.send('you need to be in a voice channel to play music!');
|
||||
} else {
|
||||
if (voiceChannel !== radio.voiceChannel) return msg.channel.send('<:redx:674263474704220182> I\'m sorry but you need to be in the same voice channel as RadioX to play music!');
|
||||
if (voiceChannel !== radio.voiceChannel) return msg.channel.send('you need to be in the same voice channel as RadioX to play music!');
|
||||
}
|
||||
if (!args[1]) return msg.channel.send('<:redx:674263474704220182> You need to use a link or search for a song!');
|
||||
if (!args[1]) return msg.channel.send('You need to use a number or search for a supported station!');
|
||||
const permissions = voiceChannel.permissionsFor(msg.client.user);
|
||||
if (!permissions.has('CONNECT')) {
|
||||
return msg.channel.send('<:redx:674263474704220182> I cannot connect to your voice channel, make sure I have the proper permissions!');
|
||||
return msg.channel.send('I cannot connect to your voice channel.');
|
||||
}
|
||||
if (!permissions.has('SPEAK')) {
|
||||
return msg.channel.send('<:redx:674263474704220182> I cannot speak in your voice channel, make sure I have the proper permissions!');
|
||||
return msg.channel.send('I cannot speak in your voice channel.');
|
||||
}
|
||||
let station;
|
||||
const number = parseInt(args[1] - 1);
|
||||
@ -28,7 +28,7 @@ module.exports = {
|
||||
return;
|
||||
} else if (!isNaN(number)) {
|
||||
if (number > client.stations.length - 1) {
|
||||
return msg.channel.send('<:redx:674263474704220182> no such station!');
|
||||
return msg.channel.send('no such station!');
|
||||
} else {
|
||||
url = client.stations[number].stream[client.stations[number].stream.default];
|
||||
station = client.stations[number];
|
||||
@ -65,7 +65,7 @@ module.exports = {
|
||||
} catch (error) {
|
||||
client.radio.delete(msg.guild.id);
|
||||
client.debug_channel.send("Error with connecting to voice channel: " + error);
|
||||
return msg.channel.send(`<:redx:674263474704220182> An error occured: ${error}`);
|
||||
return msg.channel.send(`An error occured: ${error}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -10,6 +10,6 @@ module.exports = {
|
||||
radio.connection.dispatcher.destroy();
|
||||
radio.voiceChannel.leave();
|
||||
client.radio.delete(msg.guild.id);
|
||||
msg.channel.send('<:stop:674685626108477519> Stopped the music!');
|
||||
msg.channel.send('Stopped playback!');
|
||||
}
|
||||
};
|
@ -7,15 +7,15 @@ module.exports = {
|
||||
category: 'music',
|
||||
execute(msg, args, client, Discord, prefix, command) {
|
||||
const radio = client.radio.get(msg.guild.id);
|
||||
if (!args[1] && radio) return msg.channel.send(`:loud_sound: The current volume is: **${radio.volume}**`);
|
||||
if (!args[1] && radio) return msg.channel.send(`current volume: **${radio.volume}**`);
|
||||
const volume = parseFloat(args[1]);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
if (isNaN(volume)) return msg.channel.send('<:redx:674263474704220182> I\'m sorry, But you need to enter a valid __number__.');
|
||||
if (volume > 100) return msg.channel.send('<:redx:674263474704220182> The max volume is `100`!');
|
||||
if (volume < 0) return msg.channel.send('<:redx:674263474704220182> The volume needs to be a positive number!');
|
||||
if (isNaN(volume)) return msg.channel.send('you need to enter a valid __number__.');
|
||||
if (volume > 100) return msg.channel.send('The max volume is `100`!');
|
||||
if (volume < 0) return msg.channel.send('The volume needs to be a positive number!');
|
||||
radio.volume = volume;
|
||||
radio.connection.dispatcher.setVolume(volume / 5);
|
||||
return msg.channel.send(`<:volumehigh:674685637626167307> I set the volume to: **${volume}**`);
|
||||
return msg.channel.send(`volume is now: **${volume}**`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user