aboutsummaryrefslogtreecommitdiff
path: root/discord/message.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-05-26 02:28:49 -0400
committerRapptz <[email protected]>2019-05-26 02:32:47 -0400
commit2cd6d771eceebfa8aeb641ebd5abb454d8b52d3e (patch)
tree9312a08ca2d261c1a547b240e8e4c94a31b7769e /discord/message.py
parentAdd note for Message.tts (diff)
downloaddiscord.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/message.py')
-rw-r--r--discord/message.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/message.py b/discord/message.py
index 8bbf539c..5ed97d59 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -78,6 +78,9 @@ class Attachment:
""":class:`bool`: Whether this attachment contains a spoiler."""
return self.filename.startswith('SPOILER_')
+ def __repr__(self):
+ return '<Attachment id={0.id} filename={0.filename!r} url={0.url!r}>'.format(self)
+
async def save(self, fp, *, seek_begin=True, use_cached=False):
"""|coro|
@@ -263,7 +266,7 @@ class Message:
self._update(channel, data)
def __repr__(self):
- return '<Message id={0.id} pinned={0.pinned} author={0.author!r}>'.format(self)
+ return '<Message id={0.id} channel={0.channel!r} type={0.type!r} author={0.author!r}>'.format(self)
def _try_patch(self, data, key, transform=None):
try: