Browse Source

Add missing reprs to some objects

These are WidgetMember, BaseUser, and DeletedReferencedMessage
pull/6748/head
Steve C 4 years ago
committed by GitHub
parent
commit
86f10f6dd6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      discord/message.py
  2. 6
      discord/user.py
  3. 6
      discord/widget.py

3
discord/message.py

@ -273,6 +273,9 @@ class DeletedReferencedMessage:
def __init__(self, parent):
self._parent = parent
def __repr__(self):
return f"<DeletedReferencedMessage id={self.id} channel_id={self.channel_id} guild_id={self.guild_id!r}>"
@property
def id(self):
""":class:`int`: The message ID of the deleted referenced message."""

6
discord/user.py

@ -44,6 +44,12 @@ class BaseUser(_BaseUser):
self._state = state
self._update(data)
def __repr__(self):
return (
f"<BaseUser id={self.id} name={self.name!r} discriminator={self.discriminator!r}"
f" bot={self.bot} system={self.system}>"
)
def __str__(self):
return f'{self.name}#{self.discriminator}'

6
discord/widget.py

@ -157,6 +157,12 @@ class WidgetMember(BaseUser):
self.connected_channel = connected_channel
def __repr__(self):
return (
f"<WidgetMember name={self.name!r} discriminator={self.discriminator!r}"
f" bot={self.bot} nick={self.nick!r}>"
)
@property
def display_name(self):
""":class:`str`: Returns the member's display name."""

Loading…
Cancel
Save