All Projects → lmammino → Norrisbot

lmammino / Norrisbot

Licence: mit
a Slack bot that kicks asses (roundhouse-kicks to be accurate...)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Norrisbot

Intelligo
🤖 Chatbot Framework for Node.js.
Stars: ✭ 347 (+158.96%)
Mutual labels:  bot, bots, slack-bot, slack
Awesome Bots
Awesome Links about bots.
Stars: ✭ 412 (+207.46%)
Mutual labels:  bot, bots, slack
Slack Machine
A sexy, simple, yet powerful and extendable Slack bot
Stars: ✭ 91 (-32.09%)
Mutual labels:  bot, slack-bot, slack
Botonomous
A PHP Framework For Creating Autonomous Slack Bots
Stars: ✭ 109 (-18.66%)
Mutual labels:  bot, slack-bot, slack
Go Sarah
Simple yet customizable bot framework written in Go.
Stars: ✭ 188 (+40.3%)
Mutual labels:  bot, slack-bot, slack
Sactive Bot
😈 An extensible chat bot framework. sactive-bot is an evolution of the open source hubot project. - https://www.shipengqi.top/sactive-bot .
Stars: ✭ 212 (+58.21%)
Mutual labels:  bot, slack-bot, slack
Obed Bot
🍴 Obed Slack Bot, na požiadanie kontroluje aktuálnu ponuku denného menu reštaurácii. [only for slovak|czech users]
Stars: ✭ 32 (-76.12%)
Mutual labels:  bot, slack-bot, slack
Slick
Slick, a Slack bot in Go
Stars: ✭ 150 (+11.94%)
Mutual labels:  bot, slack-bot, slack
Hubcommander
A Slack bot for GitHub organization management -- and other things too
Stars: ✭ 1,149 (+757.46%)
Mutual labels:  bot, slack-bot, slack
Jbot
Make Slack and Facebook Bots in Java.
Stars: ✭ 1,148 (+756.72%)
Mutual labels:  bot, slack-bot, slack
Botkit
Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
Stars: ✭ 10,555 (+7776.87%)
Mutual labels:  bot, bots, slack
Slack Starterbot
Python-powered simple starter Slack bot.
Stars: ✭ 169 (+26.12%)
Mutual labels:  bot, bots, slack
Java Telegram Bot Tutorial
Java Telegram Bot Tutorial. Feel free to submit issue if you found a mistake.
Stars: ✭ 165 (+23.13%)
Mutual labels:  bot, bots, tutorial
Slack Block Builder
Lightweight, no-dependency JavaScript library for creating Slack Block Kit UIs, with a builder syntax, inspired by SwiftUI.
Stars: ✭ 129 (-3.73%)
Mutual labels:  bots, slack-bot, slack
Php Slack Bot
Slack bot user written in PHP
Stars: ✭ 161 (+20.15%)
Mutual labels:  bot, slack-bot, slack
Slacker
Slack Bot Framework
Stars: ✭ 495 (+269.4%)
Mutual labels:  bot, slack-bot, slack
Awesome Bots
The most awesome list about bots ⭐️🤖
Stars: ✭ 2,864 (+2037.31%)
Mutual labels:  bots, slack-bot, slack
Marvin
The paranoid bot (framework)
Stars: ✭ 51 (-61.94%)
Mutual labels:  bot, slack-bot, slack
Ex mustang
✨ A simple, clueless bot
Stars: ✭ 67 (-50%)
Mutual labels:  bot, slack-bot, slack
Slacky
🐍 The BEST Slack Selfbot on GitHub | No Bot User, Acts Like It's You! ⭐️
Stars: ✭ 80 (-40.3%)
Mutual labels:  bot, slack-bot, slack

norrisbot

CircleCI npm version codecov Known Vulnerabilities

Make your team hyper-productive with cutting Chuck Norris jokes

The NorrisBot is a Slack bot that kicks asses, roundhouse-kicks to be precise... It's super-powered with Chuck Norris jokes and it aims to make your Slack channel even more "slacker" and enjoyable.

Chuck Norris face

NorrisBot is loaded with guns and jokes about Chuck Norris and it will tell a random joke every time that someone says “Chuck Norris” or "norrisbot" in a slack channel.

Norrisbot in action

Installation

As simple as installing any other global node package. Be sure to have npm and node (>= 4.3.2 version) installed and launch:

$ npm install -g norrisbot

Alternative Installation (binaries)

From release 2.0.3, every release comes also with dependency-free binaries for linux, mac and windows that can be downloaded in the Releases page on GitHub.

Running the NorrisBot

To run the NorrisBot you must have a valid Slack BOT token to authenticate the bot on your slack organization. Once you get it (instructions on the next paragraph) you just have to run:

NORRISBOT_TOKEN=somesecretkey norrisbot

Once the bot is up and running, you need to invite him into the channels you want it to be available in.

Getting the BOT token for your Slack channel

To allow the NorrisBot to connect your Slack channel you must provide him a BOT token. 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://loige.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 BOT token under the field API Token, copy it in a safe place and get ready to use it.

As an alternative you can create a bot by creating a custom application in the Slack developer portal. Inside the application settings you will be able to add a bot user and retrieve a OAUTH BOT token for it.

Configuration

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

Environment variable Description
NORRISBOT_TOKEN The Slack Bot User OAuth Access Token for your organisation/team (mandatory)
NORRISBOT_TRIGGERS A coma separated list of words that triggers the bot to reply with a joke (default: "Chuck Norris,norrisbot")
NORRISBOT_CATEGORIES A coma separated list to enable special joke categories like "explicit" and "nerdy" (default: "nerdy")
NORRISBOT_NO_PICTURES If set to TRUE will disable pictures in jokes (default: FALSE)
NORRISBOT_MESSAGE_COLOR The hex color used by the bot to mark it's messages (default: "#590088")

Installing on Heroku

A great place where to deploy our lovely NorrisBot is Heroku. We can go reasonably well with their free worker tier and the deploy process is reasonably easy and convenient. Let’s see how we can do that.

I am assuming you already have and account on Heroku and that you have installed and configured the Heroku toolbelt on your machine.

1. Create a new Heroku app

Create a local folder and install norrisbot on it:

mkdir norrisbot-myorg
cd norrisbot-myorg
npm init -y
npm i --save norrisbot

Then create a new app on heroku:

heroku create norrisbot-myorg

2. Configure your Heroku app:

heroku config:set --app norrisbot-myorg NORRISBOT_TOKEN=xoxb-YOUR-AWESOME-BOT-TOKEN

(of course you need to replace xoxb-YOUR-AWESOME-BOT-TOKEN with your actual token).

You can add extra configuration by defining values for the other supported environment variables if you want to customize the behavior of the bot.

3. Initialize your Heroku app

Create an Heroku Procfile (service definition)

echo "worker: node_modules/.bin/norrisbot" >> Procfile

Then prepare the project to be published through git:

git init
echo "node_modules/" >> .gitignore
git add --all
git commit -am "first version"
heroku git:remote --app norrisbot-myorg

4. Publish and launch the Heroku app

Through heroku git

git push heroku master

Stop the web app (not present but started by default by Heroku) and run the worker:

heroku ps:scale web=0 worker=1

That's it, now go on your Slack organization and start enjoying Chuck Norris jokes! 😂

Building the bot from source

If you downloaded the source code of the bot you can build the bot with

npm run build

Then you can run it with:

$ npm start

Don't forget to set your NORRISBOT_TOKEN environment variable bedore doing so and to install all the dependencies (including dev ones with NPM or Yarn).

Bugs and improvements

If you find a bug or have an idea about how to improve the NorrisBot you can open an issue or submit a pull request, it will definitely make you a better person! :P

The Making of

Version 1 of NorrisBot has been developed in collaboration with Scotch.io. A very detailed article has been published to explain every single line of code. It also explains you how to deploy the bot on a free Heroku instance, so you should give it a shot!

Building a Slack Bot with Node.js and Chuck Norris Super Powers

Enjoy your reading!

License

Licensed under MIT License. © Luciano Mammino.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].