apparently markovify sometimes returns none?

This commit is contained in:
Jess 3Jane 2018-02-20 11:34:40 -05:00
parent 8e7e3fb2c4
commit e500cf705d

6
gen.py
View file

@ -15,6 +15,10 @@ with open("corpus.txt") as fp:
print("Running...") print("Running...")
while True: while True:
print("tooting") print("tooting")
client.toot(model.make_sentence().replace(chr(31), "\n")) # This is not the best long term fix tbh
sentance = None
while sentence is None:
sentence = model.make_sentence()
client.toot(sentence.replace(chr(31), "\n"))
print("sleeping") print("sleeping")
time.sleep(60*60*3) time.sleep(60*60*3)