// Register slash command const commands = [ new SlashCommandBuilder() .setName('flag') .setDescription('Globally flag and ban a user.') .addStringOption(option => option.setName('userid') .setDescription('The ID of the user to ban') .setRequired(true)) .addStringOption(option => option.setName('reason') .setDescription('Reason for ban') .setRequired(true)) .addStringOption(option => option.setName('proof') .setDescription('Proof URL (https://...)') .setRequired(true)) .setDefaultMemberPermissions(PermissionFlagsBits.BanMembers) .toJSON() ];
const rest = new REST({ version: '10' }).setToken(MTM3ODg2MTAwMDc0ODQzNzU2NQ.GPhsa4.7ndO848a9ByFxQdbsmJrtPORP5HWgP6zdcRDWU);
if (interaction.commandName === 'flag') { const member = await interaction.guild.members.fetch(interaction.user.id);
// Check for the required role if (!member.roles.cache.has(1394360313318604933)) { return interaction.reply({ content: ' You do not have permission to use this command.', ephemeral: true }); }