Add __repr__ method to various classes

This commit is contained in:
owocado
2025-06-21 00:27:10 +05:30
committed by GitHub
parent 667e7c9065
commit 2bcbd49bc6
4 changed files with 18 additions and 0 deletions

View File

@ -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."""