Browse Source

List -> Sequence

pull/10386/head
Soheab 5 months ago
parent
commit
b758dd72ad
  1. 8
      discord/abc.py
  2. 4
      discord/invite.py

8
discord/abc.py

@ -1283,8 +1283,8 @@ class GuildChannel:
target_user: Optional[User] = None,
target_application_id: Optional[int] = None,
guest: bool = False,
roles: Optional[List[Snowflake]] = None,
users: Optional[List[Snowflake]] = None,
roles: Optional[Sequence[Snowflake]] = None,
users: Optional[Sequence[Snowflake]] = None,
) -> Invite:
"""|coro|
@ -1327,14 +1327,14 @@ class GuildChannel:
Whether the invite is a guest invite.
.. versionadded:: 2.6
roles: Optional[List[:class:`~discord.abc.Snowflake`]]
roles: Optional[Sequence[:class:`~discord.abc.Snowflake`]]
A list of roles that should be granted to the users joining via this invite.
Requires :attr:`~discord.Permissions.manage_guild` permission and cannot
assign roles with higher permissions than the bot.
.. versionadded:: 2.7
users: Optional[List[:class:`~discord.abc.Snowflake`]]
users: Optional[Sequence[:class:`~discord.abc.Snowflake`]]
A list of users that are allowed to join via this invite.
Requires :attr:`~discord.Permissions.manage_guild` permission.

4
discord/invite.py

@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE.
from __future__ import annotations
from typing import List, Optional, Union, TYPE_CHECKING
from typing import List, Optional, Sequence, Union, TYPE_CHECKING
from .asset import Asset
from .utils import parse_time, snowflake_time, _get_as_snowflake, MISSING
from .object import Object
@ -700,7 +700,7 @@ class Invite(Hashable):
async def edit(
self,
*,
users: List[Snowflake] = MISSING,
users: Sequence[Snowflake] = MISSING,
) -> None:
"""|coro|

Loading…
Cancel
Save