如何使用python SlackClient接收附件操作。如何获得用户的回复?
代码:
intro_msg = json.dumps([{"text": "Choose an action", "fallback": "You are unable to choose an option",
"callback_id": "lunch_intro", "color": "#3AA3E3", "attachment_type": "default",
"actions": [
{"name": "enroll", "text": "Enroll", "type": "button", "value": "enroll"},
{"name": "leave", "text": "Leave", "type": "button", "value": "leave"}]}])
result = self.sc.api_call("chat.postMessage", channel=channel, text="What would you like to do?",attachments=intro_msg,as_user=True)
答案 0 :(得分:1)
查看您链接的documentation以获取详细信息,例如Slack请求的数据结构如何。