Skip to content

Add support for making errors ephemeral for certain slash commands #1317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ajax146
Copy link
Contributor

@ajax146 ajax146 commented May 5, 2025

Still todo:
Add ephemeral_errors to more commands
Make this parameter do nothing if debug mode is turned on

@ajax146 ajax146 added the PR: Want for next release This PR should be merged prior to the next release label May 5, 2025
@ajax146 ajax146 added run-ci and removed run-ci labels May 17, 2025
@ajax146 ajax146 marked this pull request as ready for review June 9, 2025 14:36
@dkay0670 dkay0670 requested a review from Copilot June 16, 2025 20:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for ephemeral error responses for selected slash commands by updating the command extras and adapting the bot’s error handling to pass the ephemeral flag when sending messages.

  • Updated the extras dictionary in the whois command to include the "ephemeral_error" flag.
  • Modified the error handling in bot.py to send responses as ephemeral when configured.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
techsupport_bot/commands/whois.py Updated command extras to include "ephemeral_error".
techsupport_bot/bot.py Modified error handler to pass ephemeral errors in responses.
Comments suppressed due to low confidence (2)

techsupport_bot/commands/whois.py:36

  • Consider adding an inline comment explaining the purpose of the ephemeral_error flag for maintainability, especially noting that it should be ignored in debug mode.
"ephemeral_error": True,

techsupport_bot/bot.py:501

  • The PR description mentions that ephemeral_error should do nothing if debug mode is on, but no such check is present. Consider implementing a condition to override ephemeral_errors based on the debug mode status.
ephemeral_errors = interaction.command.extras.get("ephemeral_error", False)

@dkay0670
Copy link
Contributor

Does not check for debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Want for next release This PR should be merged prior to the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants