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

Function execute

src/handlers/loggingButtons.js:51–86  ·  view source on GitHub ↗
(interaction)

Source from the content-addressed store, hash-verified

49 ],
50
51 async execute(interaction) {
52 try {
53 if (!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)) {
54 return interaction.reply({
55 content: '❌ You need **Manage Server** permissions to use this.',
56 ephemeral: true,
57 });
58 }
59
60 if (interaction.customId === 'log_dash_refresh') {
61 return handleRefresh(interaction);
62 }
63
64 if (interaction.customId === 'log_dash_back') {
65 return handleBackToMain(interaction);
66 }
67
68 if (interaction.customId === 'log_dash_remove_filter') {
69 return handleRemoveFilterModal(interaction);
70 }
71
72 if (interaction.customId.startsWith('log_dash_add_filter:')) {
73 return handleAddFilterModal(interaction);
74 }
75
76 if (interaction.customId.startsWith('log_dash_toggle')) {
77 return handleToggle(interaction);
78 }
79 } catch (error) {
80 logger.error('Error in logging button handler:', error);
81 await interaction.reply({
82 content: '❌ An error occurred while processing your request.',
83 ephemeral: true,
84 }).catch(() => {});
85 }
86 },
87};
88
89async function handleRefresh(interaction) {

Callers

nothing calls this directly

Calls 5

handleRefreshFunction · 0.85
handleBackToMainFunction · 0.85
handleRemoveFilterModalFunction · 0.85
handleAddFilterModalFunction · 0.85
handleToggleFunction · 0.85

Tested by

no test coverage detected