2020-03-09 11:29:04 +00:00
|
|
|
module.exports = {
|
|
|
|
name: 'list',
|
|
|
|
alias: 'l',
|
|
|
|
usage: '',
|
|
|
|
description: 'List radio stations.',
|
|
|
|
permission: 'none',
|
2020-08-22 09:38:20 +00:00
|
|
|
category: 'radio',
|
2020-03-22 15:10:46 +00:00
|
|
|
execute(msg, args, client, Discord, command) {
|
2020-04-04 03:49:57 +00:00
|
|
|
let message = {};
|
|
|
|
if(!client.stations) {
|
|
|
|
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
|
|
|
return msg.channel.send(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
|
|
|
}
|
2020-03-09 11:29:04 +00:00
|
|
|
let stations = `${client.stations.map(s => `**#** ${s.name}`).join('\n')}`
|
|
|
|
const hashs = stations.split('**#**').length;
|
|
|
|
for (let i = 0; i < hashs; i++) {
|
|
|
|
stations = stations.replace('**#**', `**${i + 1}**`);
|
|
|
|
}
|
2020-03-22 15:10:46 +00:00
|
|
|
|
2020-03-09 11:29:04 +00:00
|
|
|
const embed = new Discord.MessageEmbed()
|
2020-03-12 22:53:23 +00:00
|
|
|
.setTitle(client.messages.listTitle)
|
2020-03-15 01:30:15 +00:00
|
|
|
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["list"].replace(/[^0-9]+/g, ''))
|
2020-03-09 11:29:04 +00:00
|
|
|
.setColor(client.config.embedColor)
|
|
|
|
.setDescription(stations)
|
2020-08-14 23:54:04 +00:00
|
|
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
2020-03-09 11:29:04 +00:00
|
|
|
return msg.channel.send(embed);
|
|
|
|
}
|
|
|
|
};
|