aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-11-30 17:49:51 -0500
committerRapptz <[email protected]>2015-11-30 17:49:51 -0500
commite08b278c5294625db4a31ee3f3f1ecf57dba3a20 (patch)
treef426c21cd20dfcb4b0bc4da889af45c3a7822dd6
parentUse copy.copy instead of copy.deepcopy for on_message_edit. (diff)
downloaddiscord.py-e08b278c5294625db4a31ee3f3f1ecf57dba3a20.tar.xz
discord.py-e08b278c5294625db4a31ee3f3f1ecf57dba3a20.zip
Fix multiple CHANNEL_DELETE. Fixes #51.
-rw-r--r--discord/client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index 0ad69cc2..b2d27663 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -224,8 +224,11 @@ class ConnectionState(object):
if server is not None:
channel_id = data.get('id')
channel = utils.find(lambda c: c.id == channel_id, server.channels)
- server.channels.remove(channel)
- self.dispatch('channel_delete', channel)
+ try:
+ server.channels.remove(channel)
+ self.dispatch('channel_delete', channel)
+ except ValueError:
+ return
def handle_channel_update(self, data):
server = self._get_server(data.get('guild_id'))