Coder Social home page Coder Social logo

candebot's Introduction

Candebot

Go Report Card

634885518034_68b9e6615588d0cf48f6_512

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

Features

  • Commands emulating a command line tool. Via Slack slash (/) or mentioning the bot. See /cmd. For example:
    • coc - Shows the Code of Conduct.
    • netiquette - Shows the Netiquette.
    • staff - Shows the list of staff members.
    • echo - Sending messages as the bot user. Only available to admins.
    • candebirthday - Days until @sdecandelario birthday! Something people cares.
  • Filter stopwords in messages. Suggest more inclusive alternatives to the user. See /inclusion.
  • Submission and validation of job posts. Posted in the #hiring-job-board channel via a form.
  • Message actions. For example:
    • Deleting a message and the whole thread. Only available to admins.
    • Report messages to the admins.

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:

  • BOT_BOT_USER_TOKEN - Slack bot user token. Used to authenticate the bot user.
  • BOT_BOT_ADMIN_TOKEN - Slack user token with admin rights. Used to authenticate the bot user when performing admin actions.
  • BOT_BOT_SERVER_SIGNING_SECRET - Slack app signing secret. Used to verify the authenticity of the requests.

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:

  • Compiled binary of the bot.
  • .bot.toml file with the configuration.

candebot's People

Contributors

smoya avatar dependabot[bot] avatar gonzaloserrano avatar ignasi35 avatar urielsalis avatar renovate[bot] avatar alhuelamo avatar akira28 avatar cristinaverdi avatar pbartrina avatar rogerclotet avatar ronnylt avatar sdecandelario avatar fenech avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.