From a6603bbf0e0a23d850a80ada54c9312ba7f26b15 Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Tue, 7 Mar 2023 02:15:22 +0100 Subject: [PATCH] Add missing param send_start_notification to create_instance --- discord/channel.py | 14 ++++++++++++-- discord/http.py | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index d8fe6e544..c276f54d2 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1546,7 +1546,12 @@ class StageChannel(VocalGuildChannel): return utils.get(self.guild.stage_instances, channel_id=self.id) async def create_instance( - self, *, topic: str, privacy_level: PrivacyLevel = MISSING, reason: Optional[str] = None + self, + *, + topic: str, + privacy_level: PrivacyLevel = MISSING, + send_start_notification: bool = False, + reason: Optional[str] = None, ) -> StageInstance: """|coro| @@ -1562,7 +1567,10 @@ class StageChannel(VocalGuildChannel): The stage instance's topic. privacy_level: :class:`PrivacyLevel` The stage instance's privacy level. Defaults to :attr:`PrivacyLevel.guild_only`. - reason: Optional[:class:`str`] + 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. + reason: :class:`str` The reason the stage instance was created. Shows up on the audit log. Raises @@ -1588,6 +1596,8 @@ class StageChannel(VocalGuildChannel): payload['privacy_level'] = privacy_level.value + payload['send_start_notification'] = send_start_notification + 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/http.py b/discord/http.py index 8b97504bd..1f9780578 100644 --- a/discord/http.py +++ b/discord/http.py @@ -2292,6 +2292,7 @@ class HTTPClient: 'channel_id', 'topic', 'privacy_level', + 'send_start_notification', ) payload = {k: v for k, v in payload.items() if k in valid_keys}