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
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
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
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
def no(action): text_blok = text_block('Boo! You are so boring :thumbsdown:') respond(action['response_url'], {'blocks': [text_blok]}) return OK
def yes(action): text_blok = text_block('Super! I do too :thumbsup:') respond(action['response_url'], {'blocks': [text_blok]}) return OK
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
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