Changes to branding, custom and fallback emojis. Fixed help command.

This commit is contained in:
Christer Warén
2020-03-15 03:30:15 +02:00
parent d0d6841353
commit c15076f834
10 changed files with 58 additions and 20 deletions

View File

@ -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
View 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];
}
}
}
}