mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 15:06:07 +00:00
Add __repr__ to Interaction
This commit is contained in:
parent
2c3938dd51
commit
7db391189d
@ -192,6 +192,9 @@ class Interaction(Generic[ClientT]):
|
||||
self.command_failed: bool = False
|
||||
self._from_data(data)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f'<{self.__class__.__name__} id={self.id} type={self.type!r} guild_id={self.guild_id!r} user={self.user!r}>'
|
||||
|
||||
def _from_data(self, data: InteractionPayload):
|
||||
self.id: int = int(data['id'])
|
||||
self.type: InteractionType = try_enum(InteractionType, data['type'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user