From 20e5ad99c062b4f0fa971b100b78e5b2bff04ac8 Mon Sep 17 00:00:00 2001 From: Victorsitou <67214928+Victorsitou@users.noreply.github.com> Date: Mon, 28 Nov 2022 21:20:31 -0300 Subject: [PATCH 1/8] feat(StageInstance): add `guild_scheduled_event` field to create instance --- disnake/channel.py | 14 ++++++++++++-- disnake/http.py | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/disnake/channel.py b/disnake/channel.py index e9488a030b..bdb5386622 100644 --- a/disnake/channel.py +++ b/disnake/channel.py @@ -1812,6 +1812,7 @@ async def create_instance( topic: str, privacy_level: StagePrivacyLevel = MISSING, notify_everyone: bool = False, + guild_scheduled_event: Snowflake = MISSING, reason: Optional[str] = None, ) -> StageInstance: """|coro| @@ -1832,8 +1833,6 @@ async def create_instance( The stage instance's topic. privacy_level: :class:`StagePrivacyLevel` The stage instance's privacy level. Defaults to :attr:`StagePrivacyLevel.guild_only`. - reason: Optional[:class:`str`] - The reason the stage instance was created. Shows up on the audit log. notify_everyone: :class:`bool` Whether to notify ``@everyone`` that the stage instance has started. Requires the :attr:`~Permissions.mention_everyone` permission on the stage channel. @@ -1841,6 +1840,14 @@ async def create_instance( .. versionadded:: 2.5 + guild_scheduled_event: :class:`Snowflake` + the guild scheduled event associated with the stage instance. + + .. versionadded:: 2.8 + + reason: Optional[:class:`str`] + The reason the stage instance was created. Shows up on the audit log. + Raises ------ Forbidden @@ -1872,6 +1879,9 @@ async def create_instance( payload["privacy_level"] = privacy_level.value + if guild_scheduled_event is not MISSING: + payload["guild_scheduled_event_id"] = guild_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/disnake/http.py b/disnake/http.py index 62aafbb4f4..f4d2d2b6a5 100644 --- a/disnake/http.py +++ b/disnake/http.py @@ -1963,6 +1963,7 @@ def create_stage_instance( "topic", "privacy_level", "send_start_notification", + "guild_scheduled_event_id", ) payload = {k: v for k, v in payload.items() if k in valid_keys} From efa8c2621be108e8d075402c7a3b21fe706f3f78 Mon Sep 17 00:00:00 2001 From: Victorsitou <67214928+Victorsitou@users.noreply.github.com> Date: Mon, 28 Nov 2022 21:25:20 -0300 Subject: [PATCH 2/8] docs: add changelog entry --- changelog/882.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/882.feature.rst diff --git a/changelog/882.feature.rst b/changelog/882.feature.rst new file mode 100644 index 0000000000..4f42f56ff8 --- /dev/null +++ b/changelog/882.feature.rst @@ -0,0 +1 @@ +Add `guild_scheduled_event` field to :meth:`StageInstance.create_instance` From 4ccc510d67d18e93367405174da2951463524bc9 Mon Sep 17 00:00:00 2001 From: Victorsitou <67214928+Victorsitou@users.noreply.github.com> Date: Mon, 28 Nov 2022 21:25:41 -0300 Subject: [PATCH 3/8] fix: docs --- disnake/channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disnake/channel.py b/disnake/channel.py index bdb5386622..a8b48c31b2 100644 --- a/disnake/channel.py +++ b/disnake/channel.py @@ -1840,7 +1840,7 @@ async def create_instance( .. versionadded:: 2.5 - guild_scheduled_event: :class:`Snowflake` + guild_scheduled_event: :class:`abc.Snowflake` the guild scheduled event associated with the stage instance. .. versionadded:: 2.8 From 523697a69b57bafd1a225482bd12f2293b323ee8 Mon Sep 17 00:00:00 2001 From: Victorsitou <67214928+Victorsitou@users.noreply.github.com> Date: Thu, 1 Dec 2022 09:32:20 -0300 Subject: [PATCH 4/8] docs: rewording --- disnake/channel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disnake/channel.py b/disnake/channel.py index a8b48c31b2..9e486bb57d 100644 --- a/disnake/channel.py +++ b/disnake/channel.py @@ -1841,7 +1841,8 @@ async def create_instance( .. versionadded:: 2.5 guild_scheduled_event: :class:`abc.Snowflake` - the guild scheduled event associated with the stage instance. + The guild scheduled event associated with the stage instance. + This will automatically start the scheduled event. .. versionadded:: 2.8 From 001284a7eceede38544ba633e51e0c1577dec430 Mon Sep 17 00:00:00 2001 From: Victorsitou <67214928+Victorsitou@users.noreply.github.com> Date: Thu, 1 Dec 2022 09:46:49 -0300 Subject: [PATCH 5/8] docs: fix changelog --- changelog/882.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/882.feature.rst b/changelog/882.feature.rst index 4f42f56ff8..1029c18780 100644 --- a/changelog/882.feature.rst +++ b/changelog/882.feature.rst @@ -1 +1 @@ -Add `guild_scheduled_event` field to :meth:`StageInstance.create_instance` +Add ``guild_scheduled_event`` field to :meth:`StageChannel.create_instance` From 04a55c98caf1529d6a1e855941140f5fd1d1ebe5 Mon Sep 17 00:00:00 2001 From: Victorsitou <67214928+Victorsitou@users.noreply.github.com> Date: Sat, 3 Dec 2022 11:45:06 -0300 Subject: [PATCH 6/8] docs: minor change --- disnake/channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disnake/channel.py b/disnake/channel.py index 0f2ad56bf3..0769354361 100644 --- a/disnake/channel.py +++ b/disnake/channel.py @@ -1870,7 +1870,7 @@ async def create_instance( guild_scheduled_event: :class:`abc.Snowflake` The guild scheduled event associated with the stage instance. - This will automatically start the scheduled event. + This will automatically start the guild scheduled event. .. versionadded:: 2.8 From 327e90a7e00889cae17b35c0d4335484c6497e84 Mon Sep 17 00:00:00 2001 From: Victor <67214928+Victorsitou@users.noreply.github.com> Date: Wed, 7 Dec 2022 16:18:37 -0300 Subject: [PATCH 7/8] docs: minor changes Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com> Signed-off-by: Victor <67214928+Victorsitou@users.noreply.github.com> --- changelog/882.feature.rst | 2 +- disnake/channel.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/882.feature.rst b/changelog/882.feature.rst index 1029c18780..177ab171bf 100644 --- a/changelog/882.feature.rst +++ b/changelog/882.feature.rst @@ -1 +1 @@ -Add ``guild_scheduled_event`` field to :meth:`StageChannel.create_instance` +Add ``guild_scheduled_event`` parameter to :meth:`StageChannel.create_instance`. diff --git a/disnake/channel.py b/disnake/channel.py index 0769354361..de82a7c6ae 100644 --- a/disnake/channel.py +++ b/disnake/channel.py @@ -1870,7 +1870,7 @@ async def create_instance( guild_scheduled_event: :class:`abc.Snowflake` The guild scheduled event associated with the stage instance. - This will automatically start the guild scheduled event. + Setting this will automatically start the event. .. versionadded:: 2.8 From 6653eba4bd74ed5a4d05e11fa6d2a311be0478db Mon Sep 17 00:00:00 2001 From: shiftinv <8530778+shiftinv@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:34:53 +0200 Subject: [PATCH 8/8] docs: update versionadded Signed-off-by: shiftinv <8530778+shiftinv@users.noreply.github.com> --- disnake/channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disnake/channel.py b/disnake/channel.py index 2b59b6ac28..263735e24e 100644 --- a/disnake/channel.py +++ b/disnake/channel.py @@ -2225,7 +2225,7 @@ async def create_instance( The guild scheduled event associated with the stage instance. Setting this will automatically start the event. - .. versionadded:: 2.8 + .. versionadded:: 2.10 reason: Optional[:class:`str`] The reason the stage instance was created. Shows up on the audit log.