]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 24 May 2023 12:20:20 +0000 (14:20 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 24 May 2023 12:20:20 +0000 (14:20 +0200)
- reformatted, I tried to use post_json_api() for bot postings

fba.py

diff --git a/fba.py b/fba.py
index 1eeb75bad23861a0b46b7b3a9f4f6801e7babf6e..30429525f2931974bb0d56429468762c426e36c5 100644 (file)
--- a/fba.py
+++ b/fba.py
@@ -581,9 +581,16 @@ def send_bot_post(instance: str, blocks: dict):
 
     botheaders = {**headers, **{"Authorization": "Bearer " + config["bot_token"]}}
 
-    req = reqto.post(f"{config['bot_instance']}/api/v1/statuses",
-        data={"status":message, "visibility":config['bot_visibility'], "content_type":"text/plain"},
-        headers=botheaders, timeout=10).json()
+    req = reqto.post(
+        f"{config['bot_instance']}/api/v1/statuses",
+        data={
+            "status"      : message,
+            "visibility"  : config['bot_visibility'],
+            "content_type": "text/plain"
+        },
+        headers=botheaders,
+        timeout=10
+    ).json()
 
     return True