mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 09:26:10 +00:00
Add __repr__ method to various classes
This commit is contained in:
@ -57,6 +57,9 @@ class AppInstallationType:
|
||||
self._guild: Optional[bool] = guild
|
||||
self._user: Optional[bool] = user
|
||||
|
||||
def __repr__(self):
|
||||
return f'<AppInstallationType guild={self.guild!r} user={self.user!r}>'
|
||||
|
||||
@property
|
||||
def guild(self) -> bool:
|
||||
""":class:`bool`: Whether the integration is a guild install."""
|
||||
@ -142,6 +145,9 @@ class AppCommandContext:
|
||||
self._dm_channel: Optional[bool] = dm_channel
|
||||
self._private_channel: Optional[bool] = private_channel
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f'<AppCommandContext guild={self.guild!r} dm_channel={self.dm_channel!r} private_channel={self.private_channel!r}>'
|
||||
|
||||
@property
|
||||
def guild(self) -> bool:
|
||||
""":class:`bool`: Whether the context allows usage in a guild."""
|
||||
|
Reference in New Issue
Block a user