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

Function execute

src/commands/Verification/verification.js:65–97  ·  view source on GitHub ↗
(interaction, config, client)

Source from the content-addressed store, hash-verified

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
100async function handleSetup(interaction, guild, client) {

Callers

nothing calls this directly

Calls 4

withErrorHandlingFunction · 0.90
createErrorFunction · 0.90
handleRemoveFunction · 0.85
handleSetupFunction · 0.70

Tested by

no test coverage detected