Add support for autocomplete

This commit is contained in:
Rapptz
2022-03-01 04:38:41 -05:00
parent 4e04dbdec7
commit ae1aaac5a7
10 changed files with 273 additions and 38 deletions

View File

@@ -692,7 +692,7 @@ class ConnectionState:
def parse_interaction_create(self, data: gw.InteractionCreateEvent) -> None:
interaction = Interaction(data=data, state=self)
if data['type'] == 2 and self._command_tree: # application command
if data['type'] in (2, 4) and self._command_tree: # application command and auto complete
self._command_tree._from_interaction(interaction)
elif data['type'] == 3: # interaction component
# These keys are always there for this interaction type