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.')
def test_reply_text(): assert reply_text('hello') == ('{"text": "hello"}', 200, { 'Content-Type': 'application/json' })
def hello(): my_background_job() return reply_text('Instant Response')
def hello(): form = request.form['command'] text = request.form['text'] return reply_text(f'You called `{form} {text}`')
def goodbye(): return reply_text('Goodbye')
def hello(): return reply_text('Hello from a blueprint')