diff options
Diffstat (limited to 'discord/abc.py')
| -rw-r--r-- | discord/abc.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/discord/abc.py b/discord/abc.py index 961545ed..da1636f2 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -62,6 +62,7 @@ if TYPE_CHECKING: from .channel import CategoryChannel from .embeds import Embed from .message import Message, MessageReference + from .enums import InviteTarget SnowflakeTime = Union["Snowflake", datetime] @@ -1013,6 +1014,9 @@ class GuildChannel: max_uses: int = 0, temporary: bool = False, unique: bool = True, + target_type: Optional[InviteTarget] = None, + target_user: Optional[User] = None, + target_application_id: Optional[int] = None ) -> Invite: """|coro| @@ -1038,6 +1042,20 @@ class GuildChannel: invite. reason: Optional[:class:`str`] The reason for creating this invite. Shows up on the audit log. + target_type: Optional[:class:`InviteTarget`] + The type of target for the voice channel invite, if any. + + .. versionadded:: 2.0 + + target_user: Optional[:class:`User`] + The user whose stream to display for this invite, required if `target_type` is `TargetType.stream`. The user must be streaming in the channel. + + .. versionadded:: 2.0 + + target_application_id:: Optional[:class:`int`] + The id of the embedded application for the invite, required if `target_type` is `TargetType.embedded_application`. + + .. versionadded:: 2.0 Raises ------- @@ -1060,6 +1078,9 @@ class GuildChannel: max_uses=max_uses, temporary=temporary, unique=unique, + target_type=target_type.value if target_type else None, + target_user_id=target_user.id if target_user else None, + target_application_id=target_application_id ) return Invite.from_incomplete(data=data, state=self._state) |