(interaction, config, client)
| 63 | ), |
| 64 | |
| 65 | async execute(interaction, config, client) { |
| 66 | const wrappedExecute = withErrorHandling(async () => { |
| 67 | const subcommand = interaction.options.getSubcommand(); |
| 68 | const guild = interaction.guild; |
| 69 | |
| 70 | if (!interaction.memberPermissions?.has(PermissionFlagsBits.ManageGuild)) { |
| 71 | throw createError( |
| 72 | 'Missing ManageGuild permission for verification admin subcommand', |
| 73 | ErrorTypes.PERMISSION, |
| 74 | 'You need the **Manage Server** permission to use this verification subcommand.', |
| 75 | { subcommand, requiredPermission: 'ManageGuild', userId: interaction.user.id } |
| 76 | ); |
| 77 | } |
| 78 | |
| 79 | switch (subcommand) { |
| 80 | case "setup": |
| 81 | return await handleSetup(interaction, guild, client); |
| 82 | case "remove": |
| 83 | return await handleRemove(interaction, guild, client); |
| 84 | case "dashboard": |
| 85 | return await verificationDashboard.execute(interaction, config, client); |
| 86 | default: |
| 87 | throw createError( |
| 88 | `Unknown subcommand: ${subcommand}`, |
| 89 | ErrorTypes.VALIDATION, |
| 90 | "Please select a valid subcommand.", |
| 91 | { subcommand } |
| 92 | ); |
| 93 | } |
| 94 | }, { command: 'verification', subcommand: interaction.options.getSubcommand() }); |
| 95 | |
| 96 | return await wrappedExecute(interaction, config, client); |
| 97 | } |
| 98 | }; |
| 99 | |
| 100 | async function handleSetup(interaction, guild, client) { |
nothing calls this directly
no test coverage detected