check if config file exists

This commit is contained in:
Milka64 2021-01-05 20:01:44 +01:00
parent e391b138e5
commit ef24e2a2bf

View file

@ -550,6 +550,9 @@ def main():
) )
args = parser.parse_args() args = parser.parse_args()
config = configparser.ConfigParser() config = configparser.ConfigParser()
if not os.path.exists(args.config):
logger.critical('config file not found')
exit(1)
config.read(args.config) config.read(args.config)
audio_path = config['DEFAULT']['audio_path'] audio_path = config['DEFAULT']['audio_path']
token = config['discord']['token'] token = config['discord']['token']