diff --git a/scripts/chatbot.py b/scripts/chatbot.py index e582bdb73a9b2984f54e66af8c09ac241fb11fea..efd80e69c49c318d8e239e1ca6f3c05f5ab7671a 100644 --- a/scripts/chatbot.py +++ b/scripts/chatbot.py @@ -70,13 +70,13 @@ def register_handlers(bot): try: with open(CONFIG, 'r') as fobj: config = toml.load(fobj) - shifters = msg.split("shifters are ")[1].strip() + shifters = msg[3:].strip() config['Alerts']['shifters'] = shifters with open(CONFIG, 'w') as fobj: toml.dump(config, fobj) - bot.send_message( - f'Alright, the new shifters are {shifters}, welcome!', - channel_id) + msg = f'Alright, the new shifters are {shifters}, welcome!' + print(msg) + bot.send_message(msg, channel_id) except Exception as e: bot.send_message(f'something went horribly wrong... {e}', channel_id)