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

Function execute

src/commands/Verification/verify.js:13–43  ·  view source on GitHub ↗
(interaction, config, client)

Source from the content-addressed store, hash-verified

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};

Callers

nothing calls this directly

Calls 6

withErrorHandlingFunction · 0.90
verifyUserFunction · 0.90
infoEmbedFunction · 0.90
successEmbedFunction · 0.90
replyUserErrorFunction · 0.85
safeReplyMethod · 0.80

Tested by

no test coverage detected