eximiabots-radiox/src/client/funcs/listStations.js
2021-09-06 00:52:35 +03:00

33 lines
851 B
JavaScript

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