aboutsummaryrefslogtreecommitdiff
path: root/discord/member.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-01-08 04:31:33 -0500
committerRapptz <[email protected]>2017-01-08 04:31:33 -0500
commitaae8b783e9f0005e1cc5a51f7acad9d3d6282f30 (patch)
treeb4b8dd52601ce6968fb61b47699fe72200ae1fb6 /discord/member.py
parentFix bug that caused Guild instances to be in VoiceChannel.voice_members (diff)
downloaddiscord.py-aae8b783e9f0005e1cc5a51f7acad9d3d6282f30.tar.xz
discord.py-aae8b783e9f0005e1cc5a51f7acad9d3d6282f30.zip
VoiceChannel.voice_members is now computed when needed.
Diffstat (limited to 'discord/member.py')
-rw-r--r--discord/member.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/member.py b/discord/member.py
index 467bdbbe..5201bc41 100644
--- a/discord/member.py
+++ b/discord/member.py
@@ -50,7 +50,7 @@ class VoiceState:
Indicates if the user is currently deafened by their own accord.
is_afk: bool
Indicates if the user is currently in the AFK channel in the guild.
- channel: Optional[Union[:class:`Channel`, :class:`PrivateChannel`]]
+ channel: :class:`VoiceChannel`
The voice channel that the user is currently connected to. None if the user
is not currently in a voice channel.
"""
@@ -70,6 +70,9 @@ class VoiceState:
self.deaf = data.get('deaf', False)
self.channel = channel
+ def __repr__(self):
+ return '<VoiceState self_mute={0.self_mute} self_deaf={0.self_deaf} channel={0.channel!r}>'.format(self)
+
def flatten_user(cls):
for attr, value in User.__dict__.items():
# ignore private/special methods