MCPcopy Create free account
hub / github.com/codebymitch/TitanBot / execute

Function execute

src/handlers/helpButtons.js:14–38  ·  view source on GitHub ↗
(interaction, client)

Source from the content-addressed store, hash-verified

12export const helpBackButton = {
13 name: BACK_BUTTON_ID,
14 async execute(interaction, client) {
15 try {
16 if (!interaction.deferred && !interaction.replied) {
17 await interaction.deferUpdate();
18 }
19
20 const { embeds, components } = await createInitialHelpMenu(client);
21 await interaction.editReply({
22 embeds,
23 components,
24 });
25 } catch (error) {
26 if (error?.code === 40060 || error?.code === 10062) {
27 logger.warn('Help back button interaction already acknowledged or expired.', {
28 event: 'interaction.help.button.unavailable',
29 errorCode: String(error.code),
30 customId: interaction.customId,
31 interactionId: interaction.id,
32 });
33 return;
34 }
35
36 throw error;
37 }
38 },
39};
40
41export const helpBugReportButton = {

Callers

nothing calls this directly

Calls 4

createInitialHelpMenuFunction · 0.90
createEmbedFunction · 0.90
createAllCommandsMenuFunction · 0.90
getPaginationInfoFunction · 0.85

Tested by

no test coverage detected