diff options
| author | Rapptz <[email protected]> | 2017-01-03 09:16:15 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-01-03 09:52:12 -0500 |
| commit | 7690455b21d3406cbea55b75a7ebb10423b8d14c (patch) | |
| tree | b53292d19a0d6a7f5d1f5b7f7f455ccb65fca49a /discord/state.py | |
| parent | Change Messageable channel getter to be a coroutine. (diff) | |
| download | discord.py-7690455b21d3406cbea55b75a7ebb10423b8d14c.tar.xz discord.py-7690455b21d3406cbea55b75a7ebb10423b8d14c.zip | |
Make User and Member messageable.
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/state.py b/discord/state.py index fa8c12b9..31f29545 100644 --- a/discord/state.py +++ b/discord/state.py @@ -169,6 +169,11 @@ class ConnectionState: if isinstance(channel, DMChannel): self._private_channels_by_user[channel.recipient.id] = channel + def add_dm_channel(self, data): + channel = DMChannel(me=self.user, state=self, data=data) + self._add_private_channel(channel) + return channel + def _remove_private_channel(self, channel): self._private_channels.pop(channel.id, None) if isinstance(channel, DMChannel): |