import {
SlashCommandBuilder,
CommandInteraction,
EmbedBuilder,
} from 'discord.js';
import {Discord} from '../../types/discord';
async function doHandleWhitelistCommandExecution(
interaction: CommandInteraction
): Promise<void> {
const options = interaction.options;
const action = interaction.commandName;
const profile = options.get('profile')?.value;
await interaction.reply(`Profile: ${profile} - Action: ${action}`);
}
const whitelistCommandHandler: Discord.Command = {
data: new SlashCommandBuilder()
.setName('whitelist')
.setDescription(
'Allows you to either add a user to the whitelist or to remove them'
)
.addSubcommand(subcommand =>
subcommand
.setName('add')
.setDescription('Add a player to the whitelist')
.addStringOption(option =>
option
.setName('profile')
.setDescription('Represents a link to a steam profile')
.setRequired(true)
)
)
.addSubcommand(subcommand =>
subcommand
.setName('remove')
.setDescription('Remove a player from the whitelist')
.addStringOption(option =>
option
.setName('profile')
.setDescription('Represents a link to a steam profile')
.setRequired(true)
)
),
onExecution: doHandleWhitelistCommandExecution,
};
export default whitelistCommandHandler;