Updated emojis and renamed X emoji to Error

This commit is contained in:
Christer Warén 2020-04-02 07:40:01 +03:00
parent 3c3ec6c2b4
commit 889646a6d0
3 changed files with 15 additions and 15 deletions

View File

@ -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(client.messageEmojis["x"] + client.messages.noVoiceChannel);
if (!msg.member.voice.channel) return msg.channel.send(client.messageEmojis["error"] + client.messages.noVoiceChannel);
} else {
if (voiceChannel !== radio.voiceChannel) return msg.channel.send(client.messageEmojis["x"] + client.messages.wrongVoiceChannel);
if (voiceChannel !== radio.voiceChannel) return msg.channel.send(client.messageEmojis["error"] + client.messages.wrongVoiceChannel);
}
if (!args[1]) return msg.channel.send(client.messages.noQuery);
const permissions = voiceChannel.permissionsFor(msg.client.user);
if (!permissions.has('CONNECT')) {
return msg.channel.send(client.messageEmojis["x"] + client.messages.noPermsConnect);
return msg.channel.send(client.messageEmojis["error"] + client.messages.noPermsConnect);
}
if (!permissions.has('SPEAK')) {
return msg.channel.send(client.messageEmojis["x"] + client.messages.noPermsSpeak);
return msg.channel.send(client.messageEmojis["error"] + client.messages.noPermsSpeak);
}
let station;
const number = parseInt(args[1] - 1);
@ -28,15 +28,15 @@ module.exports = {
return;
} else if (!isNaN(number)) {
if (number > client.stations.length - 1) {
return msg.channel.send(client.messageEmojis["x"] + client.messages.wrongStationNumber);
return msg.channel.send(client.messageEmojis["error"] + client.messages.wrongStationNumber);
} else {
url = client.stations[number].stream[client.stations[number].stream.default];
station = client.stations[number];
}
} else {
if (args[1].length < 3) return msg.channel.send(client.messageEmojis["x"] + client.messages.tooShortSearch);
if (args[1].length < 3) return msg.channel.send(client.messageEmojis["error"] + client.messages.tooShortSearch);
const sstation = await searchStation(args.slice(1).join(' '), client);
if (!sstation) return msg.channel.send(client.messageEmojis["x"] + client.messages.noSearchResults);
if (!sstation) return msg.channel.send(client.messageEmojis["error"] + client.messages.noSearchResults);
url = sstation.stream[sstation.stream.default];
station = sstation;
}
@ -81,7 +81,7 @@ module.exports = {
} catch (error) {
client.radio.delete(msg.guild.id);
return msg.channel.send(client.messageEmojis["x"] + `An error occured: ${error}`);
return msg.channel.send(client.messageEmojis["error"] + `An error occured: ${error}`);
}
}
};

View File

@ -3,17 +3,17 @@ module.exports = function (client, msg, command) {
const radio = client.radio.get(msg.guild.id);
const permissions = msg.channel.permissionsFor(msg.author);
if (!radio) {
msg.channel.send(client.messageEmojis["x"] + client.messages.notPlaying);
msg.channel.send(client.messageEmojis["error"] + client.messages.notPlaying);
return false;
}
if (msg.member.voice.channel !== radio.voiceChannel) {
msg.channel.send(client.messageEmojis["x"] + client.messages.wrongVoiceChannel);
msg.channel.send(client.messageEmojis["error"] + client.messages.wrongVoiceChannel);
return false;
}
if(!command.permission == 'none'){
if (!permissions.has(command.permission)) {
message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission);
msg.channel.send(client.messageEmojis["x"] + message.noPerms);
msg.channel.send(client.messageEmojis["error"] + message.noPerms);
return false;
} else return true;
} else return true;

View File

@ -7,9 +7,9 @@ module.exports = {
list: "<:RadioXList:688541155519889482>",
play: "<:RadioXPlay:688541155712827458>",
stop: "<:RadioXStop:688541155377414168>",
statistics: "<:RadioXStatistics:000000000000000000>",
maintenance: "<:RadioXMaintenance:000000000000000000>",
x: "<:RadioXX:688541155792781320>"
statistics: "<:RadioXStatistics:694954485507686421>",
maintenance: "<:RadioXMaintenance:695043843057254493>",
error: "<:RadioXError:688541155792781320>"
};
let fallbackEmojis = {
@ -20,7 +20,7 @@ module.exports = {
stop: "⏹️",
statistics: "📊",
maintenance: "🛠️",
x: "❌"
error: "❌"
};
client.messageEmojis = {};