Skip to content

fix: Use Sequence instead of List in wait_for_component hints #1764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions interactions/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,8 @@ async def wait_for_component(
messages: Optional[Union[Message, int, list]] = None,
components: Optional[
Union[
List[List[Union["BaseComponent", dict]]],
List[Union["BaseComponent", dict]],
Sequence[Sequence[Union["BaseComponent", dict]]],
Sequence[Union["BaseComponent", dict]],
"BaseComponent",
dict,
]
Expand Down
4 changes: 2 additions & 2 deletions interactions/models/discord/components.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import contextlib
import uuid
from abc import abstractmethod
from typing import Any, Dict, Iterator, List, Optional, Union, TYPE_CHECKING
from typing import Any, Dict, Iterator, List, Optional, Sequence, Union, TYPE_CHECKING

import attrs
import discord_typings
Expand Down Expand Up @@ -840,7 +840,7 @@ def spread_to_rows(*components: Union[ActionRow, Button, StringSelectMenu], max_
return ActionRow.split_components(*components, count_per_row=max_in_row)


def get_components_ids(component: Union[str, dict, list, InteractiveComponent]) -> Iterator[str]:
def get_components_ids(component: Union[str, dict, list, InteractiveComponent, Sequence]) -> Iterator[str]:
"""
Creates a generator with the `custom_id` of a component or list of components.

Expand Down
Loading