aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'))