Exemplo n.º 1
0
def update_home_view():
    user = request.form['user_id']
    sample = {
        "type": "home",
        "blocks": [
            {
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "A simple stack of blocks for the simple sample Block Kit Home tab."
                }
            },
            {
                "type": "actions",
                "elements": [
                    {
                        "type": "button",
                        "action_id": "tell_joke",
                        "text": {
                            "type": "plain_text",
                            "text": "Tell me a Joke",
                            "emoji": True
                        }
                    },
                ]
            }
        ]
    }
    resp = cli.views_publish(
        user_id=user,
        view=sample
    )
    assert resp.get('ok', False), f"Could not build home tab.\nError:\n{resp.data!r}"
    return reply_text('Home tab updated.')
Exemplo n.º 2
0
def test_reply_text():
    assert reply_text('hello') == ('{"text": "hello"}', 200, {
        'Content-Type': 'application/json'
    })
Exemplo n.º 3
0
def hello():
    my_background_job()
    return reply_text('Instant Response')
Exemplo n.º 4
0
def hello():
    form = request.form['command']
    text = request.form['text']
    return reply_text(f'You called `{form} {text}`')
Exemplo n.º 5
0
def goodbye():
    return reply_text('Goodbye')
Exemplo n.º 6
0
def hello():
    return reply_text('Hello from a blueprint')