Skip to content

A new ByWater SlackBot written using the Slack Bolt Python SDK

License

Notifications You must be signed in to change notification settings

bywatersolutions/slack-bywaterbot

Repository files navigation

slack-bywaterbot

ByWaterBot is a Slack bot written in Python using Bolt for Slack

Description

An in-depth paragraph about your project and overview of use. This bot was written specifically to fill the needs of ByWater Solutions staff. It is a replacement for the older slack-bwsbot project

Getting Started

Keywords and phrases

This bot has a number of words and phrases it listens for

  • "hello" - Bot will say hi to you!
  • "bug 1234", "bz 1234" - Bot will provide a link and info to the Koha Bugzilla for that number
  • "ticket 1234", "rt 1234" - Bot will provide a link to the given ticket number
  • "branches 1234", "branches 1234 shortname" - Bot will tell you bug branches are on the bug for the given shortname ( defaults to "bywater" )
  • "Quote Please" - Bot will give you a quote from our quotes file
  • "Refresh Karma" - Bot will download the latest version of the pep talk data

Dependencies

  • Python 3 and dependencies

Installing

pip install --no-cache-dir -r requirements.txt

Environment variables

This project uses a number of environment variables to function:

  • SLACK_BOT_TOKEN - Slack bot token
  • SLACK_APP_TOKEN - Slack app token
  • QUOTES_CSV_URL - URL to a CSV of quotes
  • KARMA_CSV_URL - URL to a CSV of karma comment possibilities
  • CREDENTIALS_JSON - Download crendentials.json from Google, put contents in this variable
  • TOKEN_JSON - Run python calendar_functions.py on the server, input given URL in lynx, copy contents of token.json into this variable
  • TWILIO_ACCOUNT_SID - SID for the Twilio account to be used ( provided by Twilio )
  • TWILIO_AUTH_TOKEN - Authentication token for the Twilio account ot be used ( provided by Twilio )
  • TWILIO_PHONE - Outgoing Twilio phone number ( e.g. +11234567890 )

Check out https://slack.dev/bolt-python/tutorial/getting-started to see how to set up the Slack tokens.

Slack Bot settings

Event Subscriptions

  • message.channels
  • message.groups
  • message.im
  • message.mpim

Permissions

Bot Token Scopes
  • channels:history
  • chat:write
  • groups:history
  • im:history
  • mpim:history
  • users:read
Google Scopes
  • calendar, read-only

Executing program

python3 bywaterbot.py

Authors

Contributors names and contact info

@kylemhall

License

This project is licensed under the GPL v3 License - see the LICENSE.md file for details

Acknowledgments

Inspiration, code snippets, etc.

About

A new ByWater SlackBot written using the Slack Bolt Python SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages