Skip to content

Commit ab64a2e

Browse files
committed
Fix typing of guilds kwargs to take Sequence instead of List
1 parent acd4a08 commit ab64a2e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

discord/app_commands/tree.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
List,
3939
Literal,
4040
Optional,
41+
Sequence,
4142
Set,
4243
Tuple,
4344
TypeVar,
@@ -84,7 +85,7 @@
8485

8586

8687
def _retrieve_guild_ids(
87-
command: Any, guild: Optional[Snowflake] = MISSING, guilds: List[Snowflake] = MISSING
88+
command: Any, guild: Optional[Snowflake] = MISSING, guilds: Sequence[Snowflake] = MISSING
8889
) -> Optional[Set[int]]:
8990
if guild is not MISSING and guilds is not MISSING:
9091
raise TypeError('cannot mix guild and guilds keyword arguments')
@@ -226,7 +227,7 @@ def add_command(
226227
/,
227228
*,
228229
guild: Optional[Snowflake] = MISSING,
229-
guilds: List[Snowflake] = MISSING,
230+
guilds: Sequence[Snowflake] = MISSING,
230231
override: bool = False,
231232
) -> None:
232233
"""Adds an application command to the tree.
@@ -786,7 +787,7 @@ def command(
786787
name: str = MISSING,
787788
description: str = MISSING,
788789
guild: Optional[Snowflake] = MISSING,
789-
guilds: List[Snowflake] = MISSING,
790+
guilds: Sequence[Snowflake] = MISSING,
790791
) -> Callable[[CommandCallback[Group, P, T]], Command[Group, P, T]]:
791792
"""Creates an application command directly under this tree.
792793
@@ -836,7 +837,7 @@ def context_menu(
836837
*,
837838
name: str = MISSING,
838839
guild: Optional[Snowflake] = MISSING,
839-
guilds: List[Snowflake] = MISSING,
840+
guilds: Sequence[Snowflake] = MISSING,
840841
) -> Callable[[ContextMenuCallback], ContextMenu]:
841842
"""Creates a application command context menu from a regular function directly under this tree.
842843

0 commit comments

Comments
 (0)