From d7153b1b5ccaa15574d0113c6173c482298a7edc Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 5 May 2017 21:45:51 -0400 Subject: [PATCH] Replace hasattr with try except in chunker. --- discord/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/client.py b/discord/client.py index 85bbca151..1cd4066c2 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 = {