Coder Social home page Coder Social logo

parkchanghan / dumbledore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jsdevkr/dumbledore

0.0 0.0 0.0 4.62 MB

A Slack Bot called Dumbledore that lets your team join houses and award house points.

License: MIT License

JavaScript 98.37% CSS 0.85% HTML 0.78%

dumbledore's Introduction

Dumbledore

A Slack Bot called Dumbledore that lets your team join houses and award house points.

Installation

  • clone this reposity to the machine you want to run the server on.
  • If you do not have node >= 7.0.0 and npm installed on your machine install it
  • in the dumbledore directory run:
$ npm install
$ cp ./data/dumbledore_sample.db ./data/dumbledore.db

Running Dumbledore

To run the Dumbledore you must have an API token to authenticate the bot on your slack channel. Once you get it (instructions on the next paragraph) you just have to run:

$ BOT_API_KEY={key} BOT_NAME={name} node bin/bot.js

Getting the API token for your Slack channel

To allow the Dumbledore to connect your Slack channel you must provide him an API key. To retrieve it you need to add a new Bot in your Slack organization by visiting the following url: https://yourorganization.slack.com/services/new/bot, where yourorganization must be substituted with the name of your organization (e.g. https://dumbledoretest.slack.com/services/new/bot). Ensure you are logged to your Slack organization in your browser and you have the admin rights to add a new bot.

You will find your API key under the field API Token, copy it in a safe place and get ready to use it.

Configuration

Dumbledore is configurable through environment variables. There are several variable available:

Environment variable Description
BOT_API_KEY this variable is mandatory and must be used to specify the API token needed by the bot to connect to your Slack organization
BOT_DB_PATH optional variable that allows you to use a different database or to move the default one to a different path
BOT_NAME the name of your bot, it’s optional and it will default to dumbledore
BOT_GITHUB_CHANNEL_ID the channel id for your teams github tracker(optional)

Development

  • We recommend the nodemon:
$ npm install -g nodemon
$ cp ./.env_sample ./.env
// You need to change `.env`
$ npm run dev

Test

$ cp ./.env_sample ./.env
// You need to change `.env`
$ npm test

Production

  • We recommend the pm2:
$ npm install -g pm2
$ cp ./pm2_sample.json ./pm2.json
// You need to change `pm2.json`
$ pm2 start ./pm2.json

Making Dumbledore

This bot was based off the work of lmammino and the norrisbot project. I created most of the bot in a few days, but this is still an early version and I recognize the code could be much inproved.

License

Licensed under MIT License.

dumbledore's People

Contributors

gimdongwoo avatar wacilpong avatar ho1234c avatar brew-brew avatar benc14 avatar swpark6 avatar stickler-ci 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.