Add back __repr__ that were deleted in the Asset redesign

The Asset PR (be227ebcf0) changed some namedtuple-deriving
classes to object-deriving classes, which meant that the free __repr__ provided by namedtuple
was removed
This commit is contained in:
Benjamin Mintz
2019-05-13 20:06:57 +00:00
committed by Rapptz
parent 859ee751f9
commit a62641bd65
3 changed files with 11 additions and 0 deletions

View File

@ -68,6 +68,10 @@ class AppInfo:
self.bot_require_code_grant = data['bot_require_code_grant']
self.owner = User(state=self._state, data=data['owner'])
def __repr__(self):
return '<{0.__class__.__name__} id={0.id} name={0.name!r} description={0.description!r} public={0.bot_public} ' \
'owner={0.owner!r}>'.format(self)
@property
def icon_url(self):
""":class:`.Asset`: Retrieves the application's icon asset."""