Skip to content
Snippets Groups Projects
Commit 706fd251 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Fix parser

parent 2d3c3729
No related branches found
No related tags found
No related merge requests found
...@@ -70,13 +70,13 @@ def register_handlers(bot): ...@@ -70,13 +70,13 @@ def register_handlers(bot):
try: try:
with open(CONFIG, 'r') as fobj: with open(CONFIG, 'r') as fobj:
config = toml.load(fobj) config = toml.load(fobj)
shifters = msg.split("shifters are ")[1].strip() shifters = msg[3:].strip()
config['Alerts']['shifters'] = shifters config['Alerts']['shifters'] = shifters
with open(CONFIG, 'w') as fobj: with open(CONFIG, 'w') as fobj:
toml.dump(config, fobj) toml.dump(config, fobj)
bot.send_message( msg = f'Alright, the new shifters are {shifters}, welcome!'
f'Alright, the new shifters are {shifters}, welcome!', print(msg)
channel_id) bot.send_message(msg, channel_id)
except Exception as e: except Exception as e:
bot.send_message(f'something went horribly wrong... {e}', bot.send_message(f'something went horribly wrong... {e}',
channel_id) channel_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment