MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / handleRemove

Function handleRemove

src/commands/Verification/verification.js:226–261  ·  view source on GitHub ↗
(interaction, guild, client)

Source from the content-addressed store, hash-verified

224}
225
226async 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}

Callers 1

executeFunction · 0.85

Calls 5

removeVerificationFunction · 0.90
infoEmbedFunction · 0.90
successEmbedFunction · 0.90
handleInteractionErrorFunction · 0.90
safeReplyMethod · 0.80

Tested by

no test coverage detected