Add support for making errors ephemeral for certain slash commands#1317
Merged
Add support for making errors ephemeral for certain slash commands#1317
Conversation
Contributor
There was a problem hiding this comment.
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)
Contributor
|
Does not check for debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Still todo:
Add ephemeral_errors to more commands
Make this parameter do nothing if debug mode is turned on