Skip to content

Commit aef54eb

Browse files
authored
fix: 🐛 Async staticmethod autocompletes are not awaited (#2966)
* :fix: Async staticmethod autocompletes not awaited * 📝 CHANGELOG.md
1 parent bffa7bd commit aef54eb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ These changes are available on the `master` branch, but have not yet been releas
6161
([#2938](https://github.com/Pycord-Development/pycord/pull/2938))
6262
- Fixed `TypeError` when using Python 3.12+ `type` syntax for typing slash command
6363
parameters. ([#2952](https://github.com/Pycord-Development/pycord/pull/2952))
64+
- Fixed autocomplete crashing when using an async staticmethod.
65+
([#2966](https://github.com/Pycord-Development/pycord/pull/2966))
6466

6567
### Deprecated
6668

discord/commands/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ async def invoke_autocomplete_callback(self, ctx: AutocompleteContext):
11251125
else:
11261126
result = option.autocomplete(ctx)
11271127

1128-
if asyncio.iscoroutinefunction(option.autocomplete):
1128+
if inspect.isawaitable(result):
11291129
result = await result
11301130

11311131
choices = [

0 commit comments

Comments
 (0)