Wrote a simple logic that slack bot will repeat the messages you sent. But if you say "flip a coin", the bot will return "Heads" or "Tails" randomly
When event happens, slack sends http post requests to negork webserver (negork reroutes to our local server flask app). Then we handle the requests and send responses back.
pip3 install slackclient
pip3 install flask
pip3 install slackeventsapi
brew install --cask ngrok
- Event subscriptions: request URL: "http://your-ngrok-url/slack/events"
- Slash command: "http://your-ngrok-url/nessage-count"
python3 bot.py
./ngrok http 5000
Everytime you close ngork, you should reset your URL in slack API