Skip to content

Commit 7db3911

Browse files
authored
Add __repr__ to Interaction
1 parent 2c3938d commit 7db3911

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

discord/interactions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ def __init__(self, *, data: InteractionPayload, state: ConnectionState[ClientT])
192192
self.command_failed: bool = False
193193
self._from_data(data)
194194

195+
def __repr__(self) -> str:
196+
return f'<{self.__class__.__name__} id={self.id} type={self.type!r} guild_id={self.guild_id!r} user={self.user!r}>'
197+
195198
def _from_data(self, data: InteractionPayload):
196199
self.id: int = int(data['id'])
197200
self.type: InteractionType = try_enum(InteractionType, data['type'])

0 commit comments

Comments
 (0)