fix(discord): clean up deferred "thinking..." after slash commands complete#3674
Merged
fix(discord): clean up deferred "thinking..." after slash commands complete#3674
Conversation
…mplete After a slash command is deferred (interaction.response.defer), the "thinking..." indicator persisted indefinitely because the code used followup.send() which creates a separate message instead of replacing or removing the deferred response. Fix: use edit_original_response() to replace "thinking..." with the confirmation text when provided, or delete_original_response() to remove it when there is no confirmation. Also consolidated /reasoning and /voice handlers to use _run_simple_slash instead of duplicating the defer+dispatch pattern. Fixes #3595.
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.
Summary
Fixes #3595. The Discord "thinking..." deferred response indicator persisted after slash commands completed because the code used
followup.send()— which creates a separate ephemeral message — instead of editing or deleting the deferred response.Fix
In
_run_simple_slash():/new→ "New conversation started~"): useedit_original_response()to replace "thinking..." with the confirmation/usage,/help): usedelete_original_response()to remove the "thinking..." indicatorAlso consolidated
/reasoningand/voicehandlers to use_run_simple_slashinstead of duplicating the defer+dispatch pattern (they had the same bug — no cleanup after defer).Test plan