mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 12:23:38 +00:00
Changes to branding, custom and fallback emojis. Fixed help command.
This commit is contained in:
@ -3,16 +3,16 @@ 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){
|
||||
msg.channel.send(client.messages.notPlaying);
|
||||
msg.channel.send(client.messageEmojis["x"] + client.messages.notPlaying);
|
||||
return false;
|
||||
}
|
||||
if (msg.member.voice.channel !== radio.voiceChannel){
|
||||
msg.channel.send(client.messages.wrongVoiceChannel);
|
||||
msg.channel.send(client.messageEmojis["x"] + client.messages.wrongVoiceChannel);
|
||||
return false;
|
||||
}
|
||||
if (!permissions.has(command.permission)) {
|
||||
message.noPerms = client.messages.noPerms.replace("%commands.permissions%", commands.permissions);
|
||||
msg.channel.send(message.noPerms);
|
||||
msg.channel.send(client.messageEmojis["x"] + message.noPerms);
|
||||
return false;
|
||||
} else return true;
|
||||
};
|
||||
|
30
struct/emojis.js
Normal file
30
struct/emojis.js
Normal file
@ -0,0 +1,30 @@
|
||||
module.exports = {
|
||||
name: 'emojis',
|
||||
async execute(client, Discord) {
|
||||
let customEmojis = {
|
||||
list: "<:RadioXList:688541155519889482>",
|
||||
play: "<:RadioXPlay:688541155712827458>",
|
||||
stop: "<:RadioXStop:688541155377414168>",
|
||||
x: "<:RadioXX:688541155792781320>"
|
||||
};
|
||||
|
||||
let fallbackEmojis = {
|
||||
list: "📜",
|
||||
play: "▶️",
|
||||
stop: "⏹️",
|
||||
x: "❌"
|
||||
};
|
||||
|
||||
client.messageEmojis = {};
|
||||
|
||||
for(customEmojiName in customEmojis){
|
||||
customEmojiID = customEmojis[customEmojiName].replace(/[^0-9]+/g, '');
|
||||
customEmoji = client.emojis.cache.get(customEmojiID);
|
||||
if(customEmoji){
|
||||
client.messageEmojis[customEmojiName] = customEmojis[customEmojiName];
|
||||
} else {
|
||||
client.messageEmojis[customEmojiName] = fallbackEmojis[customEmojiName];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user