1
0
mirror of https://github.com/Rapptz/discord.py.git synced 2025-05-09 23:39:50 +00:00

Change Message.__repr__ to show inherited type name

This commit is contained in:
Rapptz 2021-07-03 11:02:32 -04:00
parent 0b577fa209
commit 3d0dd5bc1b

@ -703,8 +703,9 @@ class Message(Hashable):
continue
def __repr__(self) -> str:
name = self.__class__.__name__
return (
f'<Message id={self.id} channel={self.channel!r} type={self.type!r} author={self.author!r} flags={self.flags!r}>'
f'<{name} id={self.id} channel={self.channel!r} type={self.type!r} author={self.author!r} flags={self.flags!r}>'
)
def _try_patch(self, data, key, transform=None) -> None:
@ -1224,7 +1225,6 @@ class Message(Hashable):
flags.suppress_embeds = suppress
payload['flags'] = flags.value
if allowed_mentions is MISSING:
if self._state.allowed_mentions is not None and self.author.id == self._state.self_id:
payload['allowed_mentions'] = self._state.allowed_mentions.to_dict()