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/activity.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/activity.py')
| -rw-r--r-- | discord/activity.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/discord/activity.py b/discord/activity.py index fd940209..692e20e9 100644 --- a/discord/activity.py +++ b/discord/activity.py @@ -152,6 +152,18 @@ class Activity(_ActivityTag): self.session_id = kwargs.pop('session_id', None) self.type = try_enum(ActivityType, kwargs.pop('type', -1)) + def __repr__(self): + attrs = ( + 'type', + 'name', + 'url', + 'details', + 'application_id', + 'session_id', + ) + mapped = ' '.join('%s=%r' % (attr, getattr(self, attr)) for attr in attrs) + return '<Activity %s>' % mapped + def to_dict(self): ret = {} for attr in self.__slots__: |