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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
15 additions and
0 deletions
-
discord/message.py
-
discord/user.py
-
discord/widget.py
|
@ -273,6 +273,9 @@ class DeletedReferencedMessage: |
|
|
def __init__(self, parent): |
|
|
def __init__(self, parent): |
|
|
self._parent = 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 |
|
|
@property |
|
|
def id(self): |
|
|
def id(self): |
|
|
""":class:`int`: The message ID of the deleted referenced message.""" |
|
|
""":class:`int`: The message ID of the deleted referenced message.""" |
|
|
|
@ -44,6 +44,12 @@ class BaseUser(_BaseUser): |
|
|
self._state = state |
|
|
self._state = state |
|
|
self._update(data) |
|
|
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): |
|
|
def __str__(self): |
|
|
return f'{self.name}#{self.discriminator}' |
|
|
return f'{self.name}#{self.discriminator}' |
|
|
|
|
|
|
|
|
|
@ -157,6 +157,12 @@ class WidgetMember(BaseUser): |
|
|
|
|
|
|
|
|
self.connected_channel = connected_channel |
|
|
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 |
|
|
@property |
|
|
def display_name(self): |
|
|
def display_name(self): |
|
|
""":class:`str`: Returns the member's display name.""" |
|
|
""":class:`str`: Returns the member's display name.""" |
|
|