mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-10 02:20:18 +00:00
Updated check.js
This commit is contained in:
parent
63e99dd2b3
commit
0b7c04d242
@ -1,19 +1,19 @@
|
|||||||
module.exports = function (client, msg, command) {
|
module.exports = function (client, msg, command) {
|
||||||
let message = {};
|
let message = {};
|
||||||
const radio = client.radio.get(msg.guild.id);
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
const permissions = msg.channel.permissionsFor(msg.author);
|
const permissions = interaction.channel.permissionsFor(interaction.user);
|
||||||
if (!radio) {
|
if (!radio) {
|
||||||
msg.channel.send(client.messageEmojis["error"] + client.messages.notPlaying);
|
interaction.reply(client.messageEmojis["error"] + client.messages.notPlaying);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (msg.member.voice.channel !== radio.voiceChannel) {
|
if (interaction.member.voice.channel !== radio.voiceChannel) {
|
||||||
msg.channel.send(client.messageEmojis["error"] + client.messages.wrongVoiceChannel);
|
interaction.reply(client.messageEmojis["error"] + client.messages.wrongVoiceChannel);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(!command.permission == 'none'){
|
if(!command.permission == 'none'){
|
||||||
if (!permissions.has(command.permission)) {
|
if (!permissions.has(command.permission)) {
|
||||||
message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission);
|
message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission);
|
||||||
msg.channel.send(client.messageEmojis["error"] + message.noPerms);
|
interaction.reply(client.messageEmojis["error"] + message.noPerms);
|
||||||
return false;
|
return false;
|
||||||
} else return true;
|
} else return true;
|
||||||
} else return true;
|
} else return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user