Преглед изворни кода

Split reportbot messages and send line-by-line

master
Chris Smith пре 6 година
родитељ
комит
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
+            )

Loading…
Откажи
Сачувај