I've been trying to learn how to build a slack bot. I'm following this tutorial:
https://www.youtube.com/watch?v=6gHvqXrfjuo
I ran ngrok on http 5000, and I have my python file running on the same port.
I'm trying to add event subscriptions, but the link doesn't respond with a challenge parameter. I get a 403 forbidden response from the post request. I currently live in a student accommodation, so I don't have my own private Internet connection from a router, but I use something called ASK4 which is the same sort of specialist ISP that hotels use I'm assuming. I thought it was my firewall at first, but after turning that off, I'm starting to think it's the nature of my connection itself. Any Ideas?
import slack
import os
from pathlib import Path
from dotenv import load_dotenv
from flask import Flask
from slackeventsapi import SlackEventAdapter
env_path = Path('.') / '.env'
load_dotenv(dotenv_path=env_path)
app = Flask(__name__)
slack_event_adapter = SlackEventAdapter(os.environ['SIGNING_SECRET'], '/slack/events', app)
client = slack.WebClient(token=os.environ['SLACK_TOKEN'])
client.chat_postMessage(channel='#acme-explosives', text="Hello World")
if __name__ == "__main__":
app.run(debug=True)
Just change Ngrok port and application port, it will help