From ef24e2a2bf550c1825a54372eb7f30debb10a56b Mon Sep 17 00:00:00 2001 From: Milka64 Date: Tue, 5 Jan 2021 20:01:44 +0100 Subject: [PATCH] check if config file exists --- kabot/kabot/kabot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 0ba0ec5..caf74cf 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -550,6 +550,9 @@ def main(): ) args = parser.parse_args() config = configparser.ConfigParser() + if not os.path.exists(args.config): + logger.critical('config file not found') + exit(1) config.read(args.config) audio_path = config['DEFAULT']['audio_path'] token = config['discord']['token']