aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-02-25 20:56:09 -0500
committerRapptz <[email protected]>2017-02-25 20:56:09 -0500
commitf6fcb62c7b14b63c416407a673c5a1fcf2128404 (patch)
treea2e3818d6ba492e0c67afe0b795172506ac7d6f3
parentWrap asyncio.wait into a saner alternative that raises TimeoutError. (diff)
downloaddiscord.py-f6fcb62c7b14b63c416407a673c5a1fcf2128404.tar.xz
discord.py-f6fcb62c7b14b63c416407a673c5a1fcf2128404.zip
Check for PrivateChannel before GuildChannel in Client.get_channel
-rw-r--r--discord/state.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/discord/state.py b/discord/state.py
index d0e0a71f..b94e3ad1 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -734,15 +734,15 @@ class ConnectionState:
if id is None:
return None
+ pm = self._get_private_channel(id)
+ if pm is not None:
+ return pm
+
for guild in self.guilds:
channel = guild.get_channel(id)
if channel is not None:
return channel
- pm = self._get_private_channel(id)
- if pm is not None:
- return pm
-
def create_message(self, *, channel, data):
return Message(state=self, channel=channel, data=data)