From a91b64f168343ecbedbf3952074d2ded6c02c933 Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Sun, 1 Oct 2023 19:41:07 +0200 Subject: [PATCH] Add missing scheduled_event field to StageChannel.create_instance --- discord/channel.py | 8 ++++++++ discord/types/channel.py | 7 +------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index 8aab1f116..991d11786 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1728,6 +1728,7 @@ class StageChannel(VocalGuildChannel): topic: str, privacy_level: PrivacyLevel = MISSING, send_start_notification: bool = False, + scheduled_event: Snowflake = MISSING, reason: Optional[str] = None, ) -> StageInstance: """|coro| @@ -1747,6 +1748,10 @@ class StageChannel(VocalGuildChannel): send_start_notification: :class:`bool` Whether to send a start notification. This sends a push notification to @everyone if ``True``. Defaults to ``False``. You must have :attr:`~Permissions.mention_everyone` to do this. + scheduled_event: :class:`~discord.abc.Snowflake` + The guild scheduled event associated with the stage instance. + + .. versionadded:: 2.1 reason: :class:`str` The reason the stage instance was created. Shows up on the audit log. @@ -1771,6 +1776,9 @@ class StageChannel(VocalGuildChannel): payload['privacy_level'] = privacy_level.value + if scheduled_event is not MISSING: + payload['guild_scheduled_event_id'] = scheduled_event.id + data = await self._state.http.create_stage_instance(**payload, reason=reason) return StageInstance(guild=self.guild, state=self._state, data=data) diff --git a/discord/types/channel.py b/discord/types/channel.py index 0219cac71..456f9edac 100644 --- a/discord/types/channel.py +++ b/discord/types/channel.py @@ -161,10 +161,6 @@ class _BaseForumChannel(_BaseTextChannel): default_forum_layout: NotRequired[ForumLayoutType] -<<<<<<< HEAD -GuildChannel = Union[ - TextChannel, NewsChannel, VoiceChannel, CategoryChannel, StageChannel, DirectoryChannel, ThreadChannel, ForumChannel -======= class ForumChannel(_BaseForumChannel): type: Literal[15] @@ -174,8 +170,7 @@ class MediaChannel(_BaseForumChannel): GuildChannel = Union[ - TextChannel, NewsChannel, VoiceChannel, CategoryChannel, StageChannel, ThreadChannel, ForumChannel, MediaChannel ->>>>>>> e6a0dc5b (Add support for media channels) + TextChannel, NewsChannel, VoiceChannel, CategoryChannel, StageChannel, DirectoryChannel, ThreadChannel, ForumChannel, MediaChannel ]