Esempio n. 1
0
def no():
    action = json.loads(request.form["payload"])

    text_blok = text_block('Boo! You are so boring :thumbsdown:')
    blocks = {'blocks': [text_blok]}
    respond(action['response_url'], blocks)
    return OK
Esempio n. 2
0
def yes():
    """You may ask here, why do we respond to response_url instead of the request itself?

    Well, slack decided you can't respond directly to interaction actions requests.
    So we must use the response_url. If you know why did they decide this please tell
    me. I'm sure they might be a reason but it isn't obvious to me..
    """
    action = json.loads(request.form["payload"])

    text_blok = text_block('Super! I do too :thumbsup:')
    blocks = {'blocks': [text_blok]}
    respond(action['response_url'], blocks)
    return OK
Esempio n. 3
0
def no(payload):
    """If a user clicks no on the hello message, execute this callback"""
    text_blok = text_block('Boo! You are so boring :thumbsdown:')
    respond(payload['response_url'], {'blocks': [text_blok]})
    return OK
Esempio n. 4
0
def yes(payload):
    """If a user clicks yes on the message above, execute this callback"""
    text_blok = text_block('Super! I do too :thumbsup:')
    respond(payload['response_url'], {'blocks': [text_blok]})
    return OK
Esempio n. 5
0
def no(action):
    text_blok = text_block('Boo! You are so boring :thumbsdown:')
    respond(action['response_url'], {'blocks': [text_blok]})
    return OK
Esempio n. 6
0
def yes(action):
    text_blok = text_block('Super! I do too :thumbsup:')
    respond(action['response_url'], {'blocks': [text_blok]})
    return OK
Esempio n. 7
0
def test_respond_call_is_async():
    with patch('requests.post') as mock_request:
        mock_request.return_value = 1
        future = respond('https://url.com', 'message')
        assert future.result(timeout=5) == 1
Esempio n. 8
0
def yes():
    action = json.loads(request.form["payload"])
    text_blok = text_block('Super! I do too :thumbsup:')
    respond(action['response_url'], {'blocks': [text_blok]})
    return OK