【发布时间】:2016-09-09 14:11:02
【问题描述】:
我开始用 Python 编写一个 Slack 机器人,但当我找不到使用两种方法中的任何一种发送格式丰富的消息的方法时就停止了:
sc.rtm_send_message("channel_name", my_message)
sc.api_call("chat.postMessage", channel="channel_name", text=my_message, username="username", icon_url="icon_url")
在哪里my_message = json.dumps({'attachments': [{...}]})
我现在知道我可以使用 webhook 方法做到这一点,但使用上述方法是否可行?
【问题讨论】: