blob: beb2f35a170b0063ba18ee42ba0fd5aaa6e272eb [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";
3import { WrappedCheck } from "jshaiku";
pineafanda6e5342022-07-03 10:03:16 +01004
5const command = (builder: SlashCommandSubcommandBuilder) =>
6 builder
pineafan63fc5e22022-08-04 22:04:10 +01007 .setName("rolemenu")
Skyler Grey75ea9172022-08-06 10:22:23 +01008 .setDescription("rolemenu") // TODO
9 .addRoleOption((option) =>
10 option
11 .setName("role")
12 .setDescription("The role to give after verifying")
13 ); // FIXME FOR FUCK SAKE
pineafanda6e5342022-07-03 10:03:16 +010014
pineafan63fc5e22022-08-04 22:04:10 +010015const callback = async (interaction: CommandInteraction): Promise<void> => {
16 console.log("we changed the charger again because fuck you");
17 await interaction.reply("You're mum");
18};
pineafanda6e5342022-07-03 10:03:16 +010019
Skyler Grey75ea9172022-08-06 10:22:23 +010020const check = (
21 interaction: CommandInteraction,
22 _defaultCheck: WrappedCheck
23) => {
24 const member = interaction.member as Discord.GuildMember;
25 if (!member.permissions.has("MANAGE_ROLES"))
26 throw "You must have the *Manage Roles* permission to use this command";
pineafanda6e5342022-07-03 10:03:16 +010027 return true;
pineafan63fc5e22022-08-04 22:04:10 +010028};
pineafanda6e5342022-07-03 10:03:16 +010029
30export { command };
31export { callback };
Skyler Grey75ea9172022-08-06 10:22:23 +010032export { check };