Python Slack bot example running on Google App Engine and subscribing to Slack events via Events API
Switch branches/tags
Nothing to show
Clone or download
Latest commit b33ef83 Apr 9, 2018

README.md

Build Status Coverage Status

gae-slack-bot

Python Slack bot example running on Google App Engine and subscribing to Slack events via Events API.

How it works?

Architecture diagram

This bot uses Slack Events API to subscribe to selected events and reply via Slack Web API.

Features

This is a proof of concept Slack bot example, which:

  • repeats every message in direct conversation or channels to which bot is invited,
  • verifies all incoming Slack events with verification token,
  • runs for free within GCP Free Tier if there is a small traffic,
  • automatically scales for larger traffic (requires billing enabled).

Installation

  1. Create a GCP project in GCP Cloud Console - see docs for details,
  2. Create a Slack app on https://api.slack.com/apps/,
  3. Add a bot user for your app,
  4. Update bot access token and verification token in settings.py,
  5. Install gcloud tool,
  6. Deploy app using gcloud app deploy command, e.g. gcloud app deploy --version v1 --project your-gcp-project-id app.yaml
  7. Visiting https://your-gcp-project-id.appspot.com page should trigger 'Hello World' message on #general channel. Slack Web API is now working!
  8. Subscribe to message.channels and message.im event types by providing https://your-gcp-project-id.appspot.com/slack/event url - see docs for details,
  9. Your bot is now working! You can start chatting with him.

Development

You can find all development setup in .travis.yml