aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-05-05 21:45:51 -0400
committerRapptz <[email protected]>2017-05-05 21:45:51 -0400
commitd7153b1b5ccaa15574d0113c6173c482298a7edc (patch)
tree2cb5fab90a9ce604042127b70cd08b2f5854335e
parentSplit on_channel_pins_update as well. (diff)
downloaddiscord.py-d7153b1b5ccaa15574d0113c6173c482298a7edc.tar.xz
discord.py-d7153b1b5ccaa15574d0113c6173c482298a7edc.zip
Replace hasattr with try except in chunker.
-rw-r--r--discord/client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index 85bbca15..1cd4066c 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -129,9 +129,9 @@ class Client:
@asyncio.coroutine
def _chunker(self, guild):
- if hasattr(guild, 'id'):
+ try:
guild_id = guild.id
- else:
+ except AttributeError:
guild_id = [s.id for s in guild]
payload = {