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

Function execute

src/commands/Fun/flip.js:13–32  ·  view source on GitHub ↗
(interaction, config, client)

Source from the content-addressed store, hash-verified

11 category: 'Fun',
12
13 async execute(interaction, config, client) {
14 try {
15 const result = Math.random() < 0.5 ? "Heads" : "Tails";
16 const emoji = result === "Heads" ? "🪙" : "🔮";
17
18 const embed = successEmbed(
19 "Heads or Tails?",
20 `The coin landed on... **${result}** ${emoji}!`,
21 );
22
23 await InteractionHelper.safeReply(interaction, { embeds: [embed] });
24 logger.debug(`Flip command executed by user ${interaction.user.id} in guild ${interaction.guildId}`);
25 } catch (error) {
26 logger.error('Flip command error:', error);
27 await handleInteractionError(interaction, error, {
28 commandName: 'flip',
29 source: 'flip_command'
30 });
31 }
32 },
33};

Callers

nothing calls this directly

Calls 3

successEmbedFunction · 0.90
handleInteractionErrorFunction · 0.90
safeReplyMethod · 0.80

Tested by

no test coverage detected