Skip to content

Commit fc3825b

Browse files
fix: basic_autocomplete values can be Iterable[OptionChoice] (#2164)
1 parent 4de4d20 commit fc3825b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

discord/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def __get__(self, instance, owner):
142142

143143
from .abc import Snowflake
144144
from .commands.context import AutocompleteContext
145+
from .commands.options import OptionChoice
145146
from .invite import Invite
146147
from .permissions import Permissions
147148
from .template import Template
@@ -156,6 +157,7 @@ class _RequestLike(Protocol):
156157
else:
157158
cached_property = _cached_property
158159
AutocompleteContext = Any
160+
OptionChoice = Any
159161

160162

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

13001302

1301-
V = Union[Iterable[str], Iterable[int], Iterable[float]]
1303+
V = Union[Iterable[OptionChoice], Iterable[str], Iterable[int], Iterable[float]]
13021304
AV = Awaitable[V]
13031305
Values = Union[V, Callable[[AutocompleteContext], Union[V, AV]], AV]
13041306
AutocompleteFunc = Callable[[AutocompleteContext], AV]

0 commit comments

Comments
 (0)