All messages reworked

This commit is contained in:
MatteZ02
2020-03-12 02:50:05 +02:00
parent 035173b6cc
commit 0a1806c9ac
9 changed files with 22 additions and 32 deletions

View File

@ -1,11 +1,11 @@
module.exports = function (client, msg, command) {
const radio = client.radio.get(msg.guild.id);
const permissions = msg.channel.permissionsFor(msg.author);
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!');
if (msg.author.id !== client.config.devId) {
if (msg.member.voice.channel !== radio.voiceChannel) return msg.channel.send(`<:redx:674263474704220182> I'm sorry but you need to be in the same voice channel as RadioX to use this command!`);
if (msg.member.voice.channel !== radio.voiceChannel) return msg.channel.send(`you need to be in the same voice channel as RadioX to use this command!`);
if (!permissions.has(command.permission)) {
msg.channel.send(`<:redx:674263474704220182> You need the \`${command.permission}\` permission to use this command!`);
msg.channel.send(`You need the \`${command.permission}\` permission to use this command!`);
return false;
} else return true;
} else return true;

View File

@ -1,11 +1,11 @@
module.exports = function (msg, args, client, Discord, prefix, command) {
const permissions = msg.channel.permissionsFor(msg.client.user);
if (!permissions.has('EMBED_LINKS')) return msg.channel.send('<:redx:674263474704220182> I cannot send embeds (Embed links), make sure I have the proper permissions!');
if (!permissions.has('EMBED_LINKS')) return msg.channel.send('I cannot send embeds (Embed links).');
try {
command.uses++;
command.execute(msg, args, client, Discord, prefix, command);
} catch (error) {
msg.reply(`<:redx:674263474704220182> there was an error trying to execute that command! Please contact support with \`${prefix}bug\`!`);
msg.reply(`Error!`);
console.error(error);
}
};

View File

@ -18,12 +18,12 @@ module.exports = async function (guild, client, url) {
console.error(error);
radio.voiceChannel.leave();
client.radio.delete(guild.id);
return radio.textChannel.send('<:redx:674263474704220182> An error has occured while playing radio!');
return radio.textChannel.send('An error has occured while playing radio!');
});
dispatcher.setVolume(radio.volume / 10);
radio.textChannel.send('Start playing');
radio.textChannel.send(`Start playing: ${radio.station.name}`);
radio.playing = true;
}