From 38af993bca0499a35ef2c6d95a9bc82515424a60 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 25 Sep 2020 21:41:27 -0700 Subject: [PATCH] Put my own creation of the Flask app back Rather than relying on the one in the Slack events API. This means the WSGI configuration should work once again. --- turbot.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/turbot.py b/turbot.py index 1939c08..92921a2 100755 --- a/turbot.py +++ b/turbot.py @@ -1,13 +1,18 @@ #!/usr/bin/env python3 +from flask import Flask + from slackeventsapi import SlackEventAdapter from slack import WebClient import os +app = Flask(__name__) + slack_signing_secret = os.environ['SLACK_SIGNING_SECRET'] slack_bot_token = os.environ['SLACK_BOT_TOKEN'] -slack_events = SlackEventAdapter(slack_signing_secret, "/slack/events") +slack_events = SlackEventAdapter(slack_signing_secret, "/slack/events", app) slack_client = WebClient(slack_bot_token) -slack_events.start(port=3000) +if __name__ == '__main__': + app.run(debug=True) -- 2.43.0