Last active
May 23, 2020 18:39
-
-
Save epmallmann/71fe1762dcffaab3f640aa17a2fbe9ff to your computer and use it in GitHub Desktop.
digaOiLambda-libparse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import urllib.parse | |
def lambda_handler(event, context): | |
body = event['body'] | |
print(body) | |
qs = urllib.parse.parse_qs(body) | |
print(qs) | |
text = '' | |
if ('text' in qs and len(qs['text']) > 0): | |
text = qs['text'][0] | |
response = { | |
"response_type": "in_channel", | |
"text": "Oi!" | |
} | |
return { | |
'statusCode': 200, | |
'body': json.dumps(response) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment