diff --git a/functions.py b/functions.py index 96f0a32..419c8d8 100755 --- a/functions.py +++ b/functions.py @@ -26,10 +26,15 @@ def make_sentence(output): for toot in toots: # TODO: find a more efficient way to do this toots_str += "\n{}".format(toot[0]) model = nlt_fixed(toots_str) - toots_str = None db.close() os.remove("toots-copy.db") + if toots_str.rstrip("\n") == "": + output.send("Database is empty! Try running main.py.") + return + + toots_str = None + sentence = None tries = 0 while sentence is None and tries < 10: