From adb01dc9a70cddaff38725d843ff0b0dc114faa5 Mon Sep 17 00:00:00 2001 From: blackfur <64478051+theblackfurguy@users.noreply.github.com> Date: Mon, 1 Feb 2021 18:35:11 +0100 Subject: [PATCH] Fixed Null messages breaking training --- run.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index 2e32dbe..c5d7ef9 100644 --- a/run.py +++ b/run.py @@ -25,7 +25,7 @@ def printhelp(): def printversion(): - print("SheepBotFrame Beta 1.46") + print("SheepBotFrame Beta 1.49") def remove_mention(m, s, i): @@ -44,7 +44,10 @@ async def download(): counter = 0 messages = [None] * trainchannel[1] async for message in channel.history(limit=trainchannel[1]): - messages[counter] = message.content + if message.content is None: + print("Found Null message, ignoring...") + else: + messages[counter] = message.content counter += 1 messages.reverse() with open("chatlogs/" + str(trainchannel[0]) + ".tmp.yml", "w") as logfile: