diff --git a/discord/abc.py b/discord/abc.py index 4c1f24618..64a0b0041 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -500,6 +500,13 @@ class GuildChannel: raise TypeError('type field must be of type ChannelType') options['type'] = ch_type.value + try: + status = options.pop('status') + except KeyError: + pass + else: + await self._state.http.edit_voice_channel_status(status, channel_id=self.id, reason=reason) + if options: return await self._state.http.edit_channel(self.id, reason=reason, **options) diff --git a/discord/channel.py b/discord/channel.py index 02f2de075..52bb47069 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1370,6 +1370,7 @@ class VoiceChannel(VocalGuildChannel): rtc_region: Optional[str] = ..., video_quality_mode: VideoQualityMode = ..., slowmode_delay: int = ..., + status: Optional[str] = ..., reason: Optional[str] = ..., ) -> VoiceChannel: ... @@ -1429,6 +1430,11 @@ class VoiceChannel(VocalGuildChannel): The camera video quality for the voice channel's participants. .. versionadded:: 2.0 + status: Optional[:class:`str`] + The new voice channel status. It can be up to 500 characters. + Can be ``None`` to remove the status. + + .. versionadded:: 2.4 Raises ------ diff --git a/discord/http.py b/discord/http.py index 409a36cc9..69c5c7799 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1163,6 +1163,13 @@ class HTTPClient: payload = {k: v for k, v in options.items() if k in valid_keys} return self.request(r, reason=reason, json=payload) + def edit_voice_channel_status( + self, status: Optional[str], *, channel_id: int, reason: Optional[str] = None + ) -> Response[None]: + r = Route('PUT', '/channels/{channel_id}/voice-status', channel_id=channel_id) + payload = {'status': status} + return self.request(r, reason=reason, json=payload) + def bulk_channel_update( self, guild_id: Snowflake,