mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
parent
37bbfdce95
commit
b1fb5ed3d7
@ -564,10 +564,17 @@ class Command(Generic[GroupT, P, T]):
|
|||||||
raise CommandInvokeError(self, e) from e
|
raise CommandInvokeError(self, e) from e
|
||||||
|
|
||||||
async def _invoke_autocomplete(self, interaction: Interaction, name: str, namespace: Namespace):
|
async def _invoke_autocomplete(self, interaction: Interaction, name: str, namespace: Namespace):
|
||||||
|
# The namespace contains the Discord provided names so this will be fine
|
||||||
|
# even if the name is renamed
|
||||||
value = namespace.__dict__[name]
|
value = namespace.__dict__[name]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
param = self._params[name]
|
param = self._params[name]
|
||||||
|
except KeyError:
|
||||||
|
# Slow case, it might be a rename
|
||||||
|
params = {param.display_name: param for param in self._params.values()}
|
||||||
|
try:
|
||||||
|
param = params[name]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise CommandSignatureMismatch(self) from None
|
raise CommandSignatureMismatch(self) from None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user