mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Add Guild.change_voice_state to control our voice state.
This commit is contained in:
parent
4de01212a4
commit
1ca257bb68
@ -2064,3 +2064,23 @@ class Guild(Hashable):
|
||||
|
||||
limit = limit or 5
|
||||
return await self._state.query_members(self, query=query, limit=limit, user_ids=user_ids, cache=cache)
|
||||
|
||||
async def change_voice_state(self, *, channel, self_mute=False, self_deaf=False):
|
||||
"""|coro|
|
||||
|
||||
Changes client's voice state in the guild.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Parameters
|
||||
-----------
|
||||
channel: Optional[:class:`VoiceChannel`]
|
||||
Channel the client wants to join. Use ``None`` to disconnect.
|
||||
self_mute: :class:`bool`
|
||||
Indicates if the client should be self-muted.
|
||||
self_deaf: :class:`bool`
|
||||
Indicates if the client should be self-deafened.
|
||||
"""
|
||||
ws = self._state._get_websocket(self.id)
|
||||
channel_id = channel.id if channel else None
|
||||
await ws.voice_state(self.id, channel_id, self_mute, self_deaf)
|
||||
|
Loading…
x
Reference in New Issue
Block a user