mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 08:44:10 +00:00
Add self_stream property to VoiceState object.
This commit is contained in:
parent
017d428db5
commit
8240454555
@ -50,6 +50,11 @@ class VoiceState:
|
||||
Indicates if the user is currently muted by their own accord.
|
||||
self_deaf: :class:`bool`
|
||||
Indicates if the user is currently deafened by their own accord.
|
||||
self_stream: :class:`bool`
|
||||
Indicates if the user is currently streaming via 'Go Live' feature.
|
||||
|
||||
.. versionadded:: 1.3.0
|
||||
|
||||
self_video: :class:`bool`
|
||||
Indicates if the user is currently broadcasting video.
|
||||
afk: :class:`bool`
|
||||
@ -60,7 +65,7 @@ class VoiceState:
|
||||
"""
|
||||
|
||||
__slots__ = ('session_id', 'deaf', 'mute', 'self_mute',
|
||||
'self_video', 'self_deaf', 'afk', 'channel')
|
||||
'self_stream', 'self_video', 'self_deaf', 'afk', 'channel')
|
||||
|
||||
def __init__(self, *, data, channel=None):
|
||||
self.session_id = data.get('session_id')
|
||||
@ -69,6 +74,7 @@ class VoiceState:
|
||||
def _update(self, data, channel):
|
||||
self.self_mute = data.get('self_mute', False)
|
||||
self.self_deaf = data.get('self_deaf', False)
|
||||
self.self_stream = data.get('self_stream', False)
|
||||
self.self_video = data.get('self_video', False)
|
||||
self.afk = data.get('suppress', False)
|
||||
self.mute = data.get('mute', False)
|
||||
@ -76,7 +82,7 @@ class VoiceState:
|
||||
self.channel = channel
|
||||
|
||||
def __repr__(self):
|
||||
return '<VoiceState self_mute={0.self_mute} self_deaf={0.self_deaf} self_video={0.self_video} channel={0.channel!r}>'.format(self)
|
||||
return '<VoiceState self_mute={0.self_mute} self_deaf={0.self_deaf} self_stream={0.self_stream} channel={0.channel!r}>'.format(self)
|
||||
|
||||
def flatten_user(cls):
|
||||
for attr, value in itertools.chain(BaseUser.__dict__.items(), User.__dict__.items()):
|
||||
|
Loading…
x
Reference in New Issue
Block a user