tournament-helper-bot/commands/events/view_whitelist.js

21 lines
677 B
JavaScript
Raw Normal View History

2024-12-28 14:04:25 +00:00
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const { whitelist } = require("../../index.js");
module.exports = {
data: new SlashCommandBuilder()
.setName('view_whitelist')
.setDescription('Посмотреть на белый список'),
async execute(interaction) {
console.log(whitelist);
const embed = new EmbedBuilder()
.setColor(0x0000FF)
.setTitle(`Игроков в БС: ${whitelist.size}`)
let ds = whitelist.size === 0 ? '*Пусто*' : '';
whitelist.forEach((value, key, map) => {
ds += `<@${value}>\n`;
});
embed.setDescription(ds);
interaction.reply({ embeds: [embed] });
},
};