Skip to content

Fix Discord slash command acknowledgements to avoid timeout errors#254

Merged
erikraft merged 1 commit intomasterfrom
codex/corrigir-erro-de-resposta-do-bot
Apr 25, 2026
Merged

Fix Discord slash command acknowledgements to avoid timeout errors#254
erikraft merged 1 commit intomasterfrom
codex/corrigir-erro-de-resposta-do-bot

Conversation

@erikraft
Copy link
Copy Markdown
Owner

Motivation

  • Prevent the Discord client from showing "The application did not respond" when a slash command is invoked but not acknowledged or the command module is not loaded.
  • Make interaction error handling more defensive so failed replies/edit attempts do not leave the interaction unresolved.

Description

  • Added a fallback reply when a chat input command is not present in client.commands to avoid silently returning (file: Discord/Bot/src/index.js).
  • Ensure interactions are acknowledged before command execution by deferring only when !interaction.deferred && !interaction.replied in the main handler (file: Discord/Bot/src/index.js).
  • Hardened the interaction error path with a nested try/catch so response failures are logged and do not throw (file: Discord/Bot/src/index.js).
  • Updated the execute handlers for /drop and /receive to call deferReply only when the interaction has not already been acknowledged (files: Discord/Bot/src/commands/drop.js, Discord/Bot/src/commands/receive.js).

Testing

  • Ran node --check Discord/Bot/src/index.js and it succeeded.
  • Ran node --check Discord/Bot/src/commands/drop.js and it succeeded.
  • Ran node --check Discord/Bot/src/commands/receive.js and it succeeded.

Codex Task

@erikraft erikraft added the codex ChatGPT Codex helps developers code easily with AI from OpenAI. label Apr 25, 2026 — with ChatGPT Codex Connector
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 25, 2026

Deploy Preview for discordactivitydrop canceled.

Name Link
🔨 Latest commit 3aeb129
🔍 Latest deploy log https://app.netlify.com/projects/discordactivitydrop/deploys/69ed1985828c3d000848e26f

@erikraft erikraft temporarily deployed to codex/corrigir-erro-de-resposta-do-bot - ErikrafT Drop - Full-Stack PR #254 April 25, 2026 19:44 — with Render Destroyed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

Warning

Rate limit exceeded

@erikraft has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6576a91-adbf-4240-b695-acac946d6c82

📥 Commits

Reviewing files that changed from the base of the PR and between c10b428 and 3aeb129.

📒 Files selected for processing (3)
  • Discord/Bot/src/commands/drop.js
  • Discord/Bot/src/commands/receive.js
  • Discord/Bot/src/index.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/corrigir-erro-de-resposta-do-bot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@erikraft erikraft merged commit fde8bdc into master Apr 25, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex ChatGPT Codex helps developers code easily with AI from OpenAI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant