Fixed Null messages breaking training

This commit is contained in:
blackfur 2021-02-01 18:35:11 +01:00
parent 4b609af0e0
commit adb01dc9a7

7
run.py
View file

@ -25,7 +25,7 @@ def printhelp():
def printversion(): def printversion():
print("SheepBotFrame Beta 1.46") print("SheepBotFrame Beta 1.49")
def remove_mention(m, s, i): def remove_mention(m, s, i):
@ -44,7 +44,10 @@ async def download():
counter = 0 counter = 0
messages = [None] * trainchannel[1] messages = [None] * trainchannel[1]
async for message in channel.history(limit=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 counter += 1
messages.reverse() messages.reverse()
with open("chatlogs/" + str(trainchannel[0]) + ".tmp.yml", "w") as logfile: with open("chatlogs/" + str(trainchannel[0]) + ".tmp.yml", "w") as logfile: