(interaction, config, client)
| 11 | .setDescription('Verify yourself and gain access to the server'), |
| 12 | |
| 13 | async execute(interaction, config, client) { |
| 14 | const wrappedExecute = withErrorHandling(async () => { |
| 15 | const guild = interaction.guild; |
| 16 | |
| 17 | const result = await verifyUser(client, guild.id, interaction.user.id, { |
| 18 | source: 'command_self', |
| 19 | moderatorId: null |
| 20 | }); |
| 21 | |
| 22 | if (!result.success) { |
| 23 | if (result.alreadyVerified) { |
| 24 | return await InteractionHelper.safeReply(interaction, { |
| 25 | embeds: [infoEmbed('Already Verified', "You are already verified.")], |
| 26 | flags: MessageFlags.Ephemeral |
| 27 | }); |
| 28 | } |
| 29 | |
| 30 | return await replyUserError(interaction, { type: ErrorTypes.UNKNOWN, message: 'An error occurred during verification. Please try again or contact an administrator.' }); |
| 31 | } |
| 32 | |
| 33 | await InteractionHelper.safeReply(interaction, { |
| 34 | embeds: [successEmbed( |
| 35 | "Verification Complete", |
| 36 | `You have been verified and given the **${result.roleName}** role! Welcome to the server! 🎉` |
| 37 | )], |
| 38 | flags: MessageFlags.Ephemeral |
| 39 | }); |
| 40 | }, { command: 'verify' }); |
| 41 | |
| 42 | return await wrappedExecute(interaction, config, client); |
| 43 | } |
| 44 | }; |
nothing calls this directly
no test coverage detected