Made /door ephemeral

This commit is contained in:
Robbe Van Herck 2018-10-02 01:01:09 +02:00
parent 6194ea59e4
commit 4ac4508108
No known key found for this signature in database
GPG key ID: 4D1C8E8FBD1C7188

View file

@ -65,8 +65,8 @@ def requires_token(token_name):
return decorator
def mattermost_response(message):
response_dict = {"response_type": response_setting,
def mattermost_response(message, ephemeral=False):
response_dict = {"response_type": "ephemeral" if ephemeral else "in_channel",
"text": message}
return Response(json.dumps(response_dict), mimetype="application/json")
@ -122,4 +122,4 @@ def slotmachien_request(username, command):
def door(username):
tokens = request.values.get('text').strip().split()
command = tokens[0].lower()
return mattermost_response(slotmachien_request(username, command))
return mattermost_response(slotmachien_request(username, command), ephemeral=True)