eximiabots-radiox/src/client/funcs/listStations.js

33 lines
851 B
JavaScript
Raw Normal View History

2021-09-05 00:11:51 +00:00
import Discord from "discord.js";
module.exports = function (client, interaction){
let stations = new Array();
let options = new Array();
2021-09-05 21:52:35 +00:00
stations = client.stations.forEach(station => {
if(station.name == "GrooveFM") return;
2021-09-05 00:11:51 +00:00
station = {
label: station.name,
description: station.owner,
value: station.name
};
2021-09-05 21:52:35 +00:00
options.push(station);
2021-09-05 00:11:51 +00:00
});
const menu = new Discord.MessageActionRow()
.addComponents(
new Discord.MessageSelectMenu()
.setCustomId('play')
.setPlaceholder('Nothing selected')
2021-09-05 21:52:35 +00:00
.addOptions(options)
2021-09-05 00:11:51 +00:00
);
stations = null;
options = null;
return interaction.reply({
content: '**Select station:**',
components: [menu],
ephemeral: true
});
}