Can't send messages with blocks
hiroki-tagami opened this issue · 1 comments
hiroki-tagami commented
This code results in an error.
from slacker import Slacker
slack = Slacker("token")
blocks = [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Start <https://google.com|Show> | <https://google.com|Cancel>"
}
},
]
slack.chat.post_message('#channnel-name', blocks=blocks)
Upon investigation, the block is not json-encoded.
Is it OK to send the modified PR?
Martian-II commented
Hi
The block must be JSON data.
Try blocks = json.dumps(blocks)
.