aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorGianluca Arbezzano <gianarb92@gmail.com>2020-01-09 15:16:30 +0100
committerAidan Epstein <aidan@jmad.org>2020-02-18 16:47:04 -0800
commit5dd79495998167d6ed12051491308bcca0a0c193 (patch)
tree70c901dc9b023661858d2b17f561eeea78bf544d /wee_slack.py
parent5ecb63022ebfb4b63bc55ed5bc8efa85edd08e87 (diff)
downloadwee-slack-5dd79495998167d6ed12051491308bcca0a0c193.tar.gz
manage unsupported block and rich text
I added support for reach_text block otherwise at the end of all messages wee-slack was printing the raw JSON block. I have also fixed the `call` block to print the right join url Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 94f5f21..4841890 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -3384,11 +3384,13 @@ def unfurl_blocks(message_json):
elif block["type"] == "actions":
block_text.append("|".join(i["text"]["text"] for i in block["elements"]))
elif block["type"] == "call":
- block_text.append(". Join via ").append(block["call"]["v1"]["join_url"])
+ block_text.append(". Join via " + block["call"]["v1"]["join_url"])
elif block["type"] == "divider":
block_text.append("\n")
elif block["type"] == "context":
block_text.append("|".join(i["text"] for i in block["elements"]))
+ elif block["type"] == "rich_text":
+ continue
else:
block_text.append(' {}<<Unsupported block type "{}">>{}'.format(w.color(config.color_deleted), block["type"], w.color("reset")))
dbg('Unsupported block: "{}"'.format(json.dumps(block)), level=4)