From 53e8e759e24bff9eb4dc9fd1f02d300daf205f7e Mon Sep 17 00:00:00 2001 From: DeltaXWizard <33706469+deltaxwizard@users.noreply.github.com> Date: Sun, 1 May 2022 17:05:13 -0400 Subject: [PATCH] fix: Fix autocomplete parsing on more than 1 argument. --- interactions/api/gateway/client.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/interactions/api/gateway/client.py b/interactions/api/gateway/client.py index 7d12c4624..6485bbc84 100644 --- a/interactions/api/gateway/client.py +++ b/interactions/api/gateway/client.py @@ -311,11 +311,14 @@ def _dispatch_event(self, event: str, data: dict) -> None: # sourcery no-metric if _context.data._json.get("options"): for option in _context.data.options: - __name, _value = self.__sub_command_context(option, _context) - _name += f"_{__name}" if __name else "" - if _value: - __args.append(_value) + if option.focused: + __name, _value = self.__sub_command_context(option, _context) + _name += f"_{__name}" if __name else "" + + if _value: + __args.append(_value) + break self._dispatch.dispatch("on_autocomplete", _context) elif data["type"] == InteractionType.MODAL_SUBMIT: