From c4352df8fc72155155338f9f7256c449417e66c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Thu, 2 May 2019 19:26:25 +0200 Subject: [PATCH] initial.txt fallback (no markov) --- delojza.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/delojza.py b/delojza.py index 2a139ba..f0c3a9c 100755 --- a/delojza.py +++ b/delojza.py @@ -464,7 +464,10 @@ if __name__ == '__main__': logging.error("No config file found, stopping.") sys.exit(-1) - markov = MarkovBlabberer("initial.txt") + try: + markov = MarkovBlabberer("initial.txt") + except FileNotFoundError: + markov = None delojza = DelojzaBot(config.get('delojza', 'tg_api_key'), config.get('delojza', 'OUT_DIR', fallback=os.path.join(_DIR_, "out")),