Skip to content

Instantly share code, notes, and snippets.

@epmallmann
Last active May 23, 2020 18:39
Show Gist options
  • Save epmallmann/71fe1762dcffaab3f640aa17a2fbe9ff to your computer and use it in GitHub Desktop.
Save epmallmann/71fe1762dcffaab3f640aa17a2fbe9ff to your computer and use it in GitHub Desktop.
digaOiLambda-libparse
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