Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
99 views
in Technique[技术] by (71.8m points)

python 3.x - slack dialog.open box not closing

I saw there were already similar questions, but the solutions suggested don't seem to work for some reason.

This is my code so far, the slash command works fine, opening the popup, but then inputting the text and clicking Request, the popup doesn't close

from flask import Flask, request, make_response
from slackclient import SlackClient

app = Flask(__name__)
channel = 'GMK3QAU' #test-private
client = SlackClient("xoxb-129609-51804835-PEdmr0WAq")


def dostuff(trigger_id, dialog):
    response = client.api_call(
        "dialog.open",
        channel=channel,
        headers={'content-type': 'x-www-form-urlencoded'},
        trigger_id=trigger_id,
        dialog=dialog)
    return response


@app.route('/refresh-projects', methods=['POST'])
def hello_there():
    trigger_id = request.form['trigger_id']
    dialog = {
        "callback_id": 'refresh_project',
        "title": "Type the string",
        "submit_label": "Request",
        "state": "Limo",
        "elements": [{
            "type": "textarea",
            "label": "Additional information",
            "name": "infobox"}]}
    response = dostuff(trigger_id, dialog)
    return make_response("", 200)


if __name__ == '__main__':
    app.run()

enter image description here

question from:https://stackoverflow.com/questions/65829907/slack-dialog-open-box-not-closing

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...