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

Function execute

src/commands/Core/help.js:147–179  ·  view source on GitHub ↗
(interaction, guildConfig, client)

Source from the content-addressed store, hash-verified

145 .setDescription("Displays the help menu with all available commands"),
146
147 async execute(interaction, guildConfig, client) {
148
149 const { MessageFlags } = await import('discord.js');
150 await InteractionHelper.safeDefer(interaction);
151
152 const { embeds, components } = await createInitialHelpMenu(client);
153
154 await InteractionHelper.safeEditReply(interaction, {
155 embeds,
156 components,
157 });
158
159 setTimeout(async () => {
160 try {
161 if (!InteractionHelper.isInteractionValid(interaction)) {
162 return;
163 }
164
165 const closedEmbed = createEmbed({
166 title: "Help menu closed",
167 description: "Help menu has been closed, use /help again.",
168 color: "secondary",
169 });
170
171 await InteractionHelper.safeEditReply(interaction, {
172 embeds: [closedEmbed],
173 components: [],
174 });
175 } catch (error) {
176
177 }
178 }, HELP_MENU_TIMEOUT_MS);
179 },
180};

Callers

nothing calls this directly

Calls 5

createEmbedFunction · 0.90
createInitialHelpMenuFunction · 0.85
safeDeferMethod · 0.80
safeEditReplyMethod · 0.80
isInteractionValidMethod · 0.80

Tested by

no test coverage detected