Add debugging logs to track bot interactions and commands
Adds console logs to the interaction handler to capture details about received interactions and the execution status of commands. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 4b9f25d1-45f3-48e0-a4f7-ab9987bf3955 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/BBAQobO Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
a90ecfcda2
commit
f1d1b916e5
1 changed files with 5 additions and 0 deletions
|
|
@ -253,7 +253,10 @@ try {
|
|||
// =============================================================================
|
||||
|
||||
client.on("interactionCreate", async (interaction) => {
|
||||
console.log(`[Interaction] Received: type=${interaction.type}, commandName=${interaction.commandName || 'N/A'}, user=${interaction.user?.tag}, guild=${interaction.guildId}`);
|
||||
|
||||
if (interaction.isChatInputCommand()) {
|
||||
console.log(`[Command] Processing: ${interaction.commandName}`);
|
||||
const command = client.commands.get(interaction.commandName);
|
||||
if (!command) {
|
||||
console.warn(`No command matching ${interaction.commandName} was found.`);
|
||||
|
|
@ -261,7 +264,9 @@ client.on("interactionCreate", async (interaction) => {
|
|||
}
|
||||
|
||||
try {
|
||||
console.log(`[Command] Executing: ${interaction.commandName}`);
|
||||
await command.execute(interaction, supabase, client);
|
||||
console.log(`[Command] Completed: ${interaction.commandName}`);
|
||||
} catch (error) {
|
||||
console.error(`Error executing ${interaction.commandName}:`, error);
|
||||
const errorEmbed = new EmbedBuilder()
|
||||
|
|
|
|||
Loading…
Reference in a new issue