mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-12 21:05:22 +00:00
Raise ClientException in Member.request_to_speak
This commit is contained in:
parent
7ff6850f17
commit
aa6fb54e99
@ -40,6 +40,7 @@ from .user import BaseUser, User, _UserTag
|
|||||||
from .activity import create_activity, ActivityTypes
|
from .activity import create_activity, ActivityTypes
|
||||||
from .permissions import Permissions
|
from .permissions import Permissions
|
||||||
from .enums import Status, try_enum
|
from .enums import Status, try_enum
|
||||||
|
from .errors import ClientException
|
||||||
from .colour import Colour
|
from .colour import Colour
|
||||||
from .object import Object
|
from .object import Object
|
||||||
|
|
||||||
@ -869,13 +870,15 @@ class Member(discord.abc.Messageable, _UserTag):
|
|||||||
|
|
||||||
Raises
|
Raises
|
||||||
-------
|
-------
|
||||||
|
ClientException
|
||||||
|
You are not connected to a voice channel.
|
||||||
Forbidden
|
Forbidden
|
||||||
You do not have the proper permissions to the action requested.
|
You do not have the proper permissions to the action requested.
|
||||||
HTTPException
|
HTTPException
|
||||||
The operation failed.
|
The operation failed.
|
||||||
"""
|
"""
|
||||||
if self.voice is None or self.voice.channel is None:
|
if self.voice is None or self.voice.channel is None:
|
||||||
raise RuntimeError('Cannot request to speak while not connected to a voice channel.')
|
raise ClientException('Cannot request to speak while not connected to a voice channel.')
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
'channel_id': self.voice.channel.id,
|
'channel_id': self.voice.channel.id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user