mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Add Interaction.channel from Discord payload
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
@ -2890,7 +2890,12 @@ class DMChannel(discord.abc.Messageable, discord.abc.PrivateChannel, Hashable):
|
||||
|
||||
def __init__(self, *, me: ClientUser, state: ConnectionState, data: DMChannelPayload):
|
||||
self._state: ConnectionState = state
|
||||
self.recipient: Optional[User] = state.store_user(data['recipients'][0])
|
||||
self.recipient: Optional[User] = None
|
||||
|
||||
recipients = data.get('recipients')
|
||||
if recipients is not None:
|
||||
self.recipient = state.store_user(recipients[0])
|
||||
|
||||
self.me: ClientUser = me
|
||||
self.id: int = int(data['id'])
|
||||
|
||||
|
Reference in New Issue
Block a user