blob: 02ab93e4bcb225aa623162b039246ea023159f34 [file] [log] [blame]
pineafan63fc5e22022-08-04 22:04:10 +01001import Discord, { CommandInteraction } from "discord.js";
pineafanda6e5342022-07-03 10:03:16 +01002import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
pineafanda6e5342022-07-03 10:03:16 +01003
4const command = (builder: SlashCommandSubcommandBuilder) =>
5 builder
pineafan63fc5e22022-08-04 22:04:10 +01006 .setName("rolemenu")
Skyler Grey75ea9172022-08-06 10:22:23 +01007 .setDescription("rolemenu") // TODO
Skyler Grey11236ba2022-08-08 21:13:33 +01008 .addRoleOption((option) => option.setName("role").setDescription("The role to give after verifying")); // FIXME FOR FUCK SAKE
pineafanda6e5342022-07-03 10:03:16 +01009
pineafan63fc5e22022-08-04 22:04:10 +010010const callback = async (interaction: CommandInteraction): Promise<void> => {
11 console.log("we changed the charger again because fuck you");
12 await interaction.reply("You're mum");
13};
pineafanda6e5342022-07-03 10:03:16 +010014
PineaFan64486c42022-12-28 09:21:04 +000015const check = (interaction: CommandInteraction) => {
Skyler Grey75ea9172022-08-06 10:22:23 +010016 const member = interaction.member as Discord.GuildMember;
17 if (!member.permissions.has("MANAGE_ROLES"))
pineafan3a02ea32022-08-11 21:35:04 +010018 throw Error("You must have the *Manage Roles* permission to use this command");
pineafanda6e5342022-07-03 10:03:16 +010019 return true;
pineafan63fc5e22022-08-04 22:04:10 +010020};
pineafanda6e5342022-07-03 10:03:16 +010021
22export { command };
23export { callback };
Skyler Grey75ea9172022-08-06 10:22:23 +010024export { check };