mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Suppress exceptions from invoking autocomplete
This commit is contained in:
1 parent
0c68eb338c
commit
4e09c34bbb
2 files changed
+11
-5
No files matched your search
@@ -1235,7 +1235,13 @@ class CommandTree(Generic[ClientT]):
|
||||
focused = next((opt['name'] for opt in options if opt.get('focused')), None)
|
||||
if focused is None:
|
||||
raise AppCommandError('This should not happen, but there is no focused element. This is a Discord bug.')
|
||||
await command._invoke_autocomplete(interaction, focused, namespace)
|
||||
|
||||
try:
|
||||
await command._invoke_autocomplete(interaction, focused, namespace)
|
||||
except Exception:
|
||||
# Suppress exception since it can't be handled anyway.
|
||||
pass
|
||||
|
||||
return
|
||||
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user