mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-10 02:20:18 +00:00
Updated emojis and renamed X emoji to Error
This commit is contained in:
parent
3c3ec6c2b4
commit
889646a6d0
@ -10,17 +10,17 @@ module.exports = {
|
|||||||
const radio = client.radio.get(msg.guild.id);
|
const radio = client.radio.get(msg.guild.id);
|
||||||
const voiceChannel = msg.member.voice.channel;
|
const voiceChannel = msg.member.voice.channel;
|
||||||
if (!radio) {
|
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 {
|
} 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);
|
if (!args[1]) return msg.channel.send(client.messages.noQuery);
|
||||||
const permissions = voiceChannel.permissionsFor(msg.client.user);
|
const permissions = voiceChannel.permissionsFor(msg.client.user);
|
||||||
if (!permissions.has('CONNECT')) {
|
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')) {
|
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;
|
let station;
|
||||||
const number = parseInt(args[1] - 1);
|
const number = parseInt(args[1] - 1);
|
||||||
@ -28,15 +28,15 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
} else if (!isNaN(number)) {
|
} else if (!isNaN(number)) {
|
||||||
if (number > client.stations.length - 1) {
|
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 {
|
} else {
|
||||||
url = client.stations[number].stream[client.stations[number].stream.default];
|
url = client.stations[number].stream[client.stations[number].stream.default];
|
||||||
station = client.stations[number];
|
station = client.stations[number];
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
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];
|
url = sstation.stream[sstation.stream.default];
|
||||||
station = sstation;
|
station = sstation;
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ module.exports = {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
client.radio.delete(msg.guild.id);
|
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}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3,17 +3,17 @@ module.exports = function (client, msg, command) {
|
|||||||
const radio = client.radio.get(msg.guild.id);
|
const radio = client.radio.get(msg.guild.id);
|
||||||
const permissions = msg.channel.permissionsFor(msg.author);
|
const permissions = msg.channel.permissionsFor(msg.author);
|
||||||
if (!radio) {
|
if (!radio) {
|
||||||
msg.channel.send(client.messageEmojis["x"] + client.messages.notPlaying);
|
msg.channel.send(client.messageEmojis["error"] + client.messages.notPlaying);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (msg.member.voice.channel !== radio.voiceChannel) {
|
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;
|
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["x"] + message.noPerms);
|
msg.channel.send(client.messageEmojis["error"] + message.noPerms);
|
||||||
return false;
|
return false;
|
||||||
} else return true;
|
} else return true;
|
||||||
} else return true;
|
} else return true;
|
||||||
|
@ -7,9 +7,9 @@ module.exports = {
|
|||||||
list: "<:RadioXList:688541155519889482>",
|
list: "<:RadioXList:688541155519889482>",
|
||||||
play: "<:RadioXPlay:688541155712827458>",
|
play: "<:RadioXPlay:688541155712827458>",
|
||||||
stop: "<:RadioXStop:688541155377414168>",
|
stop: "<:RadioXStop:688541155377414168>",
|
||||||
statistics: "<:RadioXStatistics:000000000000000000>",
|
statistics: "<:RadioXStatistics:694954485507686421>",
|
||||||
maintenance: "<:RadioXMaintenance:000000000000000000>",
|
maintenance: "<:RadioXMaintenance:695043843057254493>",
|
||||||
x: "<:RadioXX:688541155792781320>"
|
error: "<:RadioXError:688541155792781320>"
|
||||||
};
|
};
|
||||||
|
|
||||||
let fallbackEmojis = {
|
let fallbackEmojis = {
|
||||||
@ -20,7 +20,7 @@ module.exports = {
|
|||||||
stop: "⏹️",
|
stop: "⏹️",
|
||||||
statistics: "📊",
|
statistics: "📊",
|
||||||
maintenance: "🛠️",
|
maintenance: "🛠️",
|
||||||
x: "❌"
|
error: "❌"
|
||||||
};
|
};
|
||||||
|
|
||||||
client.messageEmojis = {};
|
client.messageEmojis = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user