mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Add self_deaf and self_mute params to voice connect methods
This commit is contained in:
@ -1783,6 +1783,8 @@ class Connectable(Protocol):
|
||||
timeout: float = 60.0,
|
||||
reconnect: bool = True,
|
||||
cls: Callable[[Client, Connectable], T] = MISSING,
|
||||
self_deaf: bool = False,
|
||||
self_mute: bool = False,
|
||||
) -> T:
|
||||
"""|coro|
|
||||
|
||||
@ -1802,6 +1804,14 @@ class Connectable(Protocol):
|
||||
cls: Type[:class:`~discord.VoiceProtocol`]
|
||||
A type that subclasses :class:`~discord.VoiceProtocol` to connect with.
|
||||
Defaults to :class:`~discord.VoiceClient`.
|
||||
self_mute: :class:`bool`
|
||||
Indicates if the client should be self-muted.
|
||||
|
||||
.. versionadded: 2.0
|
||||
self_deaf: :class:`bool`
|
||||
Indicates if the client should be self-deafened.
|
||||
|
||||
.. versionadded: 2.0
|
||||
|
||||
Raises
|
||||
-------
|
||||
@ -1838,7 +1848,7 @@ class Connectable(Protocol):
|
||||
state._add_voice_client(key_id, voice)
|
||||
|
||||
try:
|
||||
await voice.connect(timeout=timeout, reconnect=reconnect)
|
||||
await voice.connect(timeout=timeout, reconnect=reconnect, self_deaf=self_deaf, self_mute=self_mute)
|
||||
except asyncio.TimeoutError:
|
||||
try:
|
||||
await voice.disconnect(force=True)
|
||||
|
Reference in New Issue
Block a user