From c3e7ba367135817c482a9d376700ee2599281ef6 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 28 Nov 2015 23:05:02 -0500 Subject: [PATCH] Message.channel's Object instance has an is_private attribute now. This was to allow for basic checks such as message.channel.is_private to succeed at the very least. It is a very small mitigation and not perfect since it doesn't have every attribute that PrivateChannel itself has. However you could retrieve the user info through the Message.author attribute. --- discord/message.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/discord/message.py b/discord/message.py index be0282fda..8601e3cd9 100644 --- a/discord/message.py +++ b/discord/message.py @@ -62,6 +62,8 @@ class Message(object): The :class:`Channel` that the message was sent from. Could be a :class:`PrivateChannel` if it's a private message. In :issue:`very rare cases <21>` this could be a :class:`Object` instead. + + For the sake of convenience, this :class:`Object` instance has an attribute ``is_private`` set to ``True``. .. attribute:: server The :class:`Server` that the message belongs to. If not applicable (i.e. a PM) then it's None instead. @@ -157,7 +159,8 @@ class Message(object): self.server = None if self.channel is None: if channel_id is not None: - self.channel = Object(channel_id) + self.channel = Object(id=channel_id) + self.channel.is_private = True return if not self.channel.is_private: