mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-13 01:09:50 +00:00
Add support for setting voice channel status
This commit is contained in:
parent
d25b574b32
commit
9ce733321b
discord
@ -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)
|
||||
|
||||
|
@ -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
|
||||
------
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user