diff options
| author | Rapptz <[email protected]> | 2019-05-26 02:28:49 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-05-26 02:32:47 -0400 |
| commit | 2cd6d771eceebfa8aeb641ebd5abb454d8b52d3e (patch) | |
| tree | 9312a08ca2d261c1a547b240e8e4c94a31b7769e /discord/guild.py | |
| parent | Add note for Message.tts (diff) | |
| download | discord.py-2cd6d771eceebfa8aeb641ebd5abb454d8b52d3e.tar.xz discord.py-2cd6d771eceebfa8aeb641ebd5abb454d8b52d3e.zip | |
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.
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/guild.py b/discord/guild.py index 2a6226aa..12de00b7 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -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']) |