示例#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
示例#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
示例#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
示例#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
示例#5
0
文件: full.py 项目: fakegit/slackify
def no(action):
    text_blok = text_block('Boo! You are so boring :thumbsdown:')
    respond(action['response_url'], {'blocks': [text_blok]})
    return OK
示例#6
0
文件: full.py 项目: fakegit/slackify
def yes(action):
    text_blok = text_block('Super! I do too :thumbsup:')
    respond(action['response_url'], {'blocks': [text_blok]})
    return OK
示例#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
示例#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