(interaction)
| 10 | const traceStorage = new AsyncLocalStorage(); |
| 11 | |
| 12 | function sanitizeCommandName(interaction) { |
| 13 | if (interaction?.isChatInputCommand?.() && interaction.commandName) { |
| 14 | return interaction.commandName; |
| 15 | } |
| 16 | |
| 17 | if (interaction?.isButton?.() || interaction?.isModalSubmit?.() || interaction?.isStringSelectMenu?.()) { |
| 18 | return interaction.customId || null; |
| 19 | } |
| 20 | |
| 21 | return null; |
| 22 | } |
| 23 | |
| 24 | export function createTraceId(prefix = 'trc') { |
| 25 | return `${prefix}_${crypto.randomUUID().replace(/-/g, '')}`; |
no outgoing calls
no test coverage detected