Attachments aren't working in the following code and neither is the response_type
showing as it should be. I've also tried using Python's Slack Client, but the exact same thing is happening.
def send_message(channel_id, text):
params = {
"token" : token,
"username" : "NEW BOT",
"channel" : channel_id,
"text" : text,
"response_type": "ephemeral",
"attachments": [{ "text":"This is some text" }]
}
headers = {'content-type': 'application/json'}
slack_api = 'https://slack.com/api/chat.postMessage'
requests.get(slack_api, json=params, headers=headers)
return
@app.route('/', methods=['GET', 'POST'])
def main():
if sc.rtm_connect():
sc.rtm_read()
text = request.args.get("text")
channel_id = request.args.get("channel_id")
send_message(channel_id, text)
return Response(), 200