From 706fd2510ba174788886bdc99389bdecc3f802a0 Mon Sep 17 00:00:00 2001
From: Tamas Gal <tgal@km3net.de>
Date: Wed, 2 Oct 2019 23:29:46 +0200
Subject: [PATCH] Fix parser

---
 scripts/chatbot.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/chatbot.py b/scripts/chatbot.py
index e582bdb..efd80e6 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)
-- 
GitLab