mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-08 10:53:10 +00:00
Make __repr__ slightly more detailed and add a few missing ones.
This includes raw events (which didn't have any) and a few other types that were missing them. Upon review some more useful fields were added to the repr output which would be more useful during debugging.
This commit is contained in:
@ -160,7 +160,12 @@ class Guild(Hashable):
|
||||
return self.name
|
||||
|
||||
def __repr__(self):
|
||||
return '<Guild id={0.id} name={0.name!r} chunked={0.chunked}>'.format(self)
|
||||
attrs = (
|
||||
'id', 'name', 'shard_id', 'chunked'
|
||||
)
|
||||
resolved = ['%s=%r' % (attr, getattr(self, attr)) for attr in attrs]
|
||||
resolved.append('member_count=%r' % getattr(self, '_member_count', None))
|
||||
return '<Guild %s>' % ' '.join(resolved)
|
||||
|
||||
def _update_voice_state(self, data, channel_id):
|
||||
user_id = int(data['user_id'])
|
||||
|
Reference in New Issue
Block a user