(interaction, guild, client)
| 224 | } |
| 225 | |
| 226 | async function handleRemove(interaction, guild, client) { |
| 227 | const targetUser = interaction.options.getUser("user"); |
| 228 | |
| 229 | try { |
| 230 | const result = await removeVerification(client, guild.id, targetUser.id, { |
| 231 | moderatorId: interaction.user.id, |
| 232 | reason: 'admin_removal' |
| 233 | }); |
| 234 | |
| 235 | if (!result.success) { |
| 236 | if (result.notVerified) { |
| 237 | return await InteractionHelper.safeReply(interaction, { |
| 238 | embeds: [infoEmbed('Not Verified', `${targetUser.tag} does not currently have the verified role.`)], |
| 239 | flags: MessageFlags.Ephemeral |
| 240 | }); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | logger.info('Verification removed via command', { |
| 245 | guildId: guild.id, |
| 246 | targetUserId: targetUser.id, |
| 247 | moderatorId: interaction.user.id |
| 248 | }); |
| 249 | |
| 250 | return await InteractionHelper.safeReply(interaction, { |
| 251 | embeds: [successEmbed('Verification Removed', `Verification removed from ${targetUser.tag}.`)] |
| 252 | }); |
| 253 | |
| 254 | } catch (error) { |
| 255 | await handleInteractionError( |
| 256 | interaction, |
| 257 | error, |
| 258 | { command: 'verification', subcommand: 'remove' } |
| 259 | ); |
| 260 | } |
| 261 | } |
no test coverage detected