bcneng / candebot

Our lovely opinionated slack bot
MIT License
17 stars 15 forks source link
bot hacktoberfest slack

Candebot

Go Report Card

634885518034_68b9e6615588d0cf48f6_512

Our lovely opinionated Slack bot. Find it in BcnEng Slack workspace as @candebot.

Features

Configuration

Candebot can be configured via Toml file + environment variables. The need for setting up environment variables when using the Toml file is due to the fact that some of the configurations is sensitive and should not be stored in a file.

Environment variables

All environment variables are prefixed with BOT_. For example, BOT_BOT_USER_TOKEN. If you want to change the prefix, you can set -env-prefix <prefix> flag when running the bot.

The following environment variables are needed in order to run the bot:

There are more environment variables that can be set. Please, check /bot/config.go.

Toml File

By default, ./.bot.toml is used as the configuration file. If you want to change the path, you can set -config <filepath> flag when running the bot.

Please, use the following file as a reference.

Installation

go get -u github.com/bcneng/candebot

Usage

BOT_BOT_USER_TOKEN=<slack-bot-user-token> \
BOT_BOT_ADMIN_TOKEN=<slack-user-with-admin-rights-token> \ 
BOT_BOT_SERVER_SIGNING_SECRET=<slack-app-signing-secret> \

candebot

You can get your bot user token by creating a Slack app via https://api.slack.com/apps.

Deployment

There is no preference for deployment. You can deploy it in any way you want. For example, using Docker. The files required will always be: