From 62b4c30d52636993e74994297595f575790b0fc5 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 22 Sep 2017 02:10:37 +0000 Subject: [PATCH] Copy all channels to a seperate list before iterating --- discordbot/fetch_last_messages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discordbot/fetch_last_messages.py b/discordbot/fetch_last_messages.py index bc9b8a8..484a2d8 100644 --- a/discordbot/fetch_last_messages.py +++ b/discordbot/fetch_last_messages.py @@ -69,7 +69,8 @@ class Titan(discord.Client): return print("working on this...") - for channel in self.get_all_channels(): + all_channels = list(self.get_all_channels()) + for channel in all_channels: try: if str(channel.type) == "text": print("Processing channel: ID-{} Name-'{}' ServerID-{} Server-'{}'".format(channel.id, channel.name, channel.server.id, channel.server.name))