Skip to content

Commit 65a9358

Browse files
authored
fix: Fix autocomplete parsing on more than 1 argument. (#772)
1 parent ec746fc commit 65a9358

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

interactions/api/gateway/client.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,14 @@ def _dispatch_event(self, event: str, data: dict) -> None: # sourcery no-metric
311311

312312
if _context.data._json.get("options"):
313313
for option in _context.data.options:
314-
__name, _value = self.__sub_command_context(option, _context)
315-
_name += f"_{__name}" if __name else ""
316314

317-
if _value:
318-
__args.append(_value)
315+
if option.focused:
316+
__name, _value = self.__sub_command_context(option, _context)
317+
_name += f"_{__name}" if __name else ""
318+
319+
if _value:
320+
__args.append(_value)
321+
break
319322

320323
self._dispatch.dispatch("on_autocomplete", _context)
321324
elif data["type"] == InteractionType.MODAL_SUBMIT:

0 commit comments

Comments
 (0)