21 lines
677 B
JavaScript
21 lines
677 B
JavaScript
|
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] });
|
||
|
},
|
||
|
};
|