{"id":15634633,"url":"https://github.com/lmammino/norrisbot","last_synced_at":"2025-04-06T10:12:11.893Z","repository":{"id":36067645,"uuid":"40366881","full_name":"lmammino/norrisbot","owner":"lmammino","description":"a Slack bot that kicks asses (roundhouse-kicks to be accurate...)","archived":false,"fork":false,"pushed_at":"2024-07-06T06:52:39.000Z","size":3581,"stargazers_count":136,"open_issues_count":28,"forks_count":104,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T07:11:00.355Z","etag":null,"topics":["bot","bots","chuck-norris","javascript","jokes","kicks-asses","node","node-js","nodejs","norrisbot","slack","slack-bot","tutorial","tutorials"],"latest_commit_sha":null,"homepage":"https://scotch.io/tutorials/building-a-slack-bot-with-node-js-and-chuck-norris-super-powers","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmammino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-07T15:20:09.000Z","updated_at":"2024-09-08T19:16:47.000Z","dependencies_parsed_at":"2024-07-06T07:49:40.118Z","dependency_job_id":"720bc986-6438-4b15-9d9c-8e313ac082df","html_url":"https://github.com/lmammino/norrisbot","commit_stats":{"total_commits":40,"total_committers":4,"mean_commits":10.0,"dds":0.275,"last_synced_commit":"f983ca313443ef02ba25d08ac20b96a29fd11574"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmammino%2Fnorrisbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmammino%2Fnorrisbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmammino%2Fnorrisbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmammino%2Fnorrisbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmammino","download_url":"https://codeload.github.com/lmammino/norrisbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464223,"owners_count":20942970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","bots","chuck-norris","javascript","jokes","kicks-asses","node","node-js","nodejs","norrisbot","slack","slack-bot","tutorial","tutorials"],"created_at":"2024-10-03T10:54:52.776Z","updated_at":"2025-04-06T10:12:11.858Z","avatar_url":"https://github.com/lmammino.png","language":"JavaScript","readme":"# norrisbot\n\n[![CircleCI](https://circleci.com/gh/lmammino/norrisbot.svg?style=shield)](https://circleci.com/gh/lmammino/norrisbot) [![npm version](https://badge.fury.io/js/norrisbot.svg)](http://badge.fury.io/js/norrisbot) [![codecov](https://codecov.io/gh/lmammino/norrisbot/branch/master/graph/badge.svg)](https://codecov.io/gh/lmammino/norrisbot)\n[![Known Vulnerabilities](https://snyk.io/test/github/lmammino/norrisbot/badge.svg)](https://snyk.io/test/github/lmammino/norrisbot)\n\n## Make your team hyper-productive with cutting Chuck Norris jokes\n\nThe 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.\n\n![Chuck Norris face](assets/norrisbot-logo-small.png)\n\nNorrisBot 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.\n\n![Norrisbot in action](assets/screenshot.png)\n\n\n## Installation\n\nAs simple as installing any other global node package. Be sure to have npm and node (`\u003e= 4.3.2` version) installed and launch:\n\n```bash\n$ npm install -g norrisbot\n```\n\n\n### Alternative Installation (binaries)\n\nFrom 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](https://github.com/lmammino/norrisbot/releases).\n\n\n## Running the NorrisBot\n\nTo run the NorrisBot you must have a valid Slack [BOT token](#getting-the-bot-token-for-your-slack-channel) to authenticate the bot on your slack organization. Once you get it (instructions on the next paragraph) you just have to run:\n\n\n```bash\nNORRISBOT_TOKEN=somesecretkey norrisbot\n```\n\nOnce the bot is up and running, you need to invite him into the channels you want it to be available in.\n\n\n## Getting the BOT token for your Slack channel\n\nTo 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.\n\nYou will find your BOT token under the field `API Token`, copy it in a safe place and get ready to use it.\n\nAs an alternative you can create a bot by creating a custom application in the [Slack developer portal](https://api.slack.com/apps). Inside the application settings you will be able to add a bot user and retrieve a OAUTH BOT token for it.\n\n\n## Configuration\n\nThe NorrisBot is configurable through environment variables. There are several variable available:\n\n\n| Environment variable | Description |\n|----------------------|-------------|\n| `NORRISBOT_TOKEN` | The Slack Bot User OAuth Access Token for your organisation/team *(mandatory)* |\n| `NORRISBOT_TRIGGERS` |  A coma separated list of words that triggers the bot to reply with a joke *(default: `\"Chuck Norris,norrisbot\"`)* |\n| `NORRISBOT_CATEGORIES` | A coma separated list to enable special joke categories like \"explicit\" and \"nerdy\" *(default: `\"nerdy\"`)* |\n| `NORRISBOT_NO_PICTURES` | If set to TRUE will disable pictures in jokes *(default: `FALSE`)* |\n| `NORRISBOT_MESSAGE_COLOR` | The hex color used by the bot to mark it's messages *(default: `\"#590088\"`)* |\n\n\n## Installing on Heroku\n\nA great place where to deploy our lovely NorrisBot is [Heroku](https://heroku.com). 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.\n\nI am assuming you already have and account on Heroku and that you have installed and configured the [Heroku toolbelt](https://devcenter.heroku.com/articles/heroku-cli) on your machine.\n\n### 1. Create a new Heroku app\n\nCreate a local folder and install norrisbot on it:\n\n```bash\nmkdir norrisbot-myorg\ncd norrisbot-myorg\nnpm init -y\nnpm i --save norrisbot\n```\n\nThen create a new app on heroku:\n\n```bash\nheroku create norrisbot-myorg\n```\n\n### 2. Configure your Heroku app:\n\n```bash\nheroku config:set --app norrisbot-myorg NORRISBOT_TOKEN=xoxb-YOUR-AWESOME-BOT-TOKEN\n```\n\n(of course you need to replace `xoxb-YOUR-AWESOME-BOT-TOKEN` with your actual token).\n\nYou can add extra configuration by defining values for the [other supported environment variables](#configuration) if you want to customize the behavior of the bot.\n\n### 3. Initialize your Heroku app\n\nCreate an Heroku `Procfile` (service definition)\n\n```bash\necho \"worker: node_modules/.bin/norrisbot\" \u003e\u003e Procfile\n```\n\nThen prepare the project to be published through git:\n\n```bash\ngit init\necho \"node_modules/\" \u003e\u003e .gitignore\ngit add --all\ngit commit -am \"first version\"\nheroku git:remote --app norrisbot-myorg\n```\n\n### 4. Publish and launch the Heroku app\n\nThrough heroku git\n\n```bash\ngit push heroku master\n```\n\nStop the web app (not present but started by default by Heroku) and run the worker:\n\n```bash\nheroku ps:scale web=0 worker=1\n```\n\nThat's it, now go on your Slack organization and start enjoying Chuck Norris jokes! 😂\n\n\n## Building the bot from source\n\nIf you downloaded the source code of the bot you can build the bot with\n\n```bash\nnpm run build\n```\n\nThen you can run it with:\n\n```bash\n$ npm start\n```\n\nDon'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).\n\n\n## Bugs and improvements\n\nIf you find a bug or have an idea about how to improve the NorrisBot you can [open an issue](https://github.com/lmammino/norrisbot/issues) or [submit a pull request](https://github.com/lmammino/norrisbot/pulls), it will definitely make you a better person! :P\n\n\n## The Making of\n\nVersion 1 of NorrisBot has been developed in collaboration with [Scotch.io](https://scotch.io). A [very detailed article](https://scotch.io/tutorials/building-a-slack-bot-with-node-js-and-chuck-norris-super-powers) 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!\n\n[![Building a Slack Bot with Node.js and Chuck Norris Super Powers](https://scotch.io/wp-content/uploads/2015/09/build-a-slack-bot-with-node-and-chuck-norris-super-powers.png)](https://scotch.io/tutorials/building-a-slack-bot-with-node-js-and-chuck-norris-super-powers)\n\nEnjoy your reading!\n\n\n## License\n\nLicensed under [MIT License](LICENSE). © Luciano Mammino.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmammino%2Fnorrisbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmammino%2Fnorrisbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmammino%2Fnorrisbot/lists"}