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

Function execute

src/interactions/modals/config_modal.js:93–108  ·  view source on GitHub ↗
(interaction)

Source from the content-addressed store, hash-verified

91export default {
92 name: 'config_modal',
93 async execute(interaction) {
94 const [key, guildId] = interaction.customId.split(':').slice(1);
95
96 try {
97 const value = resolveModalValue(key, interaction);
98 await ConfigService.updateSetting(interaction.client, guildId, key, value, interaction.user.id);
99
100 await interaction.reply({
101 embeds: [successEmbed('Configuration Updated', buildSuccessMessage(key, value, interaction.guild))],
102 flags: MessageFlags.Ephemeral,
103 });
104 } catch (error) {
105 logger.error('Config modal handler error:', error);
106 await replyUserError(interaction, { type: ErrorTypes.CONFIGURATION, message: 'error.message || \'Please try again.\'' });
107 }
108 },
109};

Callers

nothing calls this directly

Calls 5

successEmbedFunction · 0.90
resolveModalValueFunction · 0.85
buildSuccessMessageFunction · 0.85
replyUserErrorFunction · 0.85
updateSettingMethod · 0.80

Tested by

no test coverage detected