Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created April 7, 2025 17:10
Show Gist options
  • Select an option

  • Save KyMidd/9254fb98e4a95f4bb408f5a18af7ec90 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/9254fb98e4a95f4bb408f5a18af7ec90 to your computer and use it in GitHub Desktop.
def lambda_handler(event, context):
"""
Receives Slack events, performs basic validation, and asynchronously invokes the processor Lambda
"""
print("Received event: %s", json.dumps(event))
try:
# Parse the event body
body = json.loads(event['body'])
# Handle Slack URL verification challenge
if 'challenge' in body:
return {
'statusCode': 200,
'body': json.dumps({'challenge': body['challenge']})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment