Просмотр исходного кода

Split reportbot messages and send line-by-line

master
Chris Smith 6 лет назад
Родитель
Сommit
3e4f44a8cd
1 измененных файлов: 5 добавлений и 4 удалений
  1. 5
    4
      lineandsinker/services/reportbot.py

+ 5
- 4
lineandsinker/services/reportbot.py Просмотреть файл

@@ -11,7 +11,8 @@ class ReportBot(Service):
11 11
         self._channel = channel
12 12
 
13 13
     def announce(self, message):
14
-        requests.post(
15
-            self._url,
16
-            {"key": self._key, "command": f"CM {self._channel}", "args": message},
17
-        )
14
+        for line in message.split("\n"):
15
+            requests.post(
16
+                self._url,
17
+                {"key": self._key, "command": f"CM {self._channel}", "args": line},
18
+            )

Загрузка…
Отмена
Сохранить