Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,7 @@ async def create_instance(
topic: str,
privacy_level: StagePrivacyLevel = MISSING,
reason: Optional[str] = None,
send_notification: Optional[bool] = False,
) -> StageInstance:
"""|coro|

Expand All @@ -1281,6 +1282,9 @@ async def create_instance(
The stage instance's privacy level. Defaults to :attr:`StagePrivacyLevel.guild_only`.
reason: :class:`str`
The reason the stage instance was created. Shows up on the audit log.
send_notification: :class:`bool`
Send a notification to everyone in the server that the stage instance has started.
Defaults to ``False``. Requires the ``mention_everyone`` permission.

Raises
------
Expand All @@ -1297,7 +1301,7 @@ async def create_instance(
The newly created stage instance.
"""

payload: Dict[str, Any] = {"channel_id": self.id, "topic": topic}
payload: Dict[str, Any] = {"channel_id": self.id, "topic": topic, "send_start_notification": send_notification}

if privacy_level is not MISSING:
if not isinstance(privacy_level, StagePrivacyLevel):
Expand Down
4 changes: 4 additions & 0 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,9 +1907,13 @@ def create_stage_instance(self, *, reason: Optional[str], **payload: Any) -> Res
"channel_id",
"topic",
"privacy_level",
"send_start_notification",
)
payload = {k: v for k, v in payload.items() if k in valid_keys}

if payload.get("send_start_notification") is not None:
payload["send_start_notification"] = int(payload["send_start_notification"])

return self.request(Route("POST", "/stage-instances"), json=payload, reason=reason)

def edit_stage_instance(
Expand Down