Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 18, 2021
1 parent 80f3260 commit 7299577
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions interactions/api/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def check_sub_command(option: dict) -> dict:
for sub_option in option["options"]:
kwargs[sub_option["name"]] = sub_option["value"]
else:
kwargs[option['name']] = option['value']
kwargs[option["name"]] = option["value"]

return kwargs

Expand Down Expand Up @@ -314,15 +314,21 @@ def check_sub_auto(option: dict) -> tuple:
if context.data._json.get("options"):
if context.data.options:
for option in context.data.options:
_kwargs.update(check_sub_command(option if isinstance(option, dict) else option._json))
_kwargs.update(
check_sub_command(
option if isinstance(option, dict) else option._json
)
)
elif data["type"] == InteractionType.MESSAGE_COMPONENT:
_name = context.data.custom_id
elif data["type"] == InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE:
_name = "autocomplete_"
if context.data._json.get("options"):
if context.data.options:
for option in context.data.options:
add_name, add_args = check_sub_auto(option if isinstance(option, dict) else option._json)
add_name, add_args = check_sub_auto(
option if isinstance(option, dict) else option._json
)
if add_name:
_name += add_name
if add_args:
Expand Down

0 comments on commit 7299577

Please sign in to comment.