Skip to content

Commit

Permalink
fix: basic_autocomplete values can be Iterable[OptionChoice] (#2164)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarrotManMatt committed Jul 9, 2023
1 parent 4de4d20 commit fc3825b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion discord/utils.py
Expand Up @@ -142,6 +142,7 @@ def __get__(self, instance, owner):

from .abc import Snowflake
from .commands.context import AutocompleteContext
from .commands.options import OptionChoice
from .invite import Invite
from .permissions import Permissions
from .template import Template
Expand All @@ -156,6 +157,7 @@ class _RequestLike(Protocol):
else:
cached_property = _cached_property
AutocompleteContext = Any
OptionChoice = Any


T = TypeVar("T")
Expand Down Expand Up @@ -1298,7 +1300,7 @@ def generate_snowflake(dt: datetime.datetime | None = None) -> int:
return int(dt.timestamp() * 1000 - DISCORD_EPOCH) << 22 | 0x3FFFFF


V = Union[Iterable[str], Iterable[int], Iterable[float]]
V = Union[Iterable[OptionChoice], Iterable[str], Iterable[int], Iterable[float]]
AV = Awaitable[V]
Values = Union[V, Callable[[AutocompleteContext], Union[V, AV]], AV]
AutocompleteFunc = Callable[[AutocompleteContext], AV]
Expand Down

0 comments on commit fc3825b

Please sign in to comment.