funsocietyirc / MrNodeBot

Your Friendly NodeJs IRC Bot Framework
27 stars 7 forks source link
analytics bot fsociety irc knex nodebots

Mr. NodeBot

An IronY / FSociety Production

Build Status Dependencies devDependencies Status Known Vulnerabilities

Snyk Intergration

Since this is an IRC bot, and one cannot predict the type of character the bot may encounter in the wild, this project makes use of the Snyk vulnerabilitie patching system. You should regularly check the snyk patching system by running npm run snyk-protect.

Special Considerations

The bot currently depends on NickServ services supporting the ACC command for certain command authentication types. Networks confirmed to work include

Dependencies

Install Steps

Keep the Bot Running

Included in the root directory is a sample systemd script (misc/mrnodebot.service), you can do it this way or use forever or any other node task runner. If you want to be able to use commands like update, restart, and halt while having the Bot come back it is important you take this into consideration.

Features

Debugging

You will find various debugging flags inside the config file. These will granually conroll file based debugging options. This framework does take advantage of SocketIO and express, which both utilize the Debug module. If you would like to see very intricate debugging for both express and socketIO, start the bot with the following command DEBUG=* node index.js.

Unit Testing

Unit testing is being introduced and has a long way to go to catch up. To run available tests npm test

Documentation

I am currently in the processes of providing jsdoc style docblocks for documentation generation. You can generate the documentation by running npm run generate-docs

Technologies

API Keys

URL Shortner service

The Url shortner service, found in scripts/libs/_getShortService will provide a url shortner based on your API key availability. const shortService = require('../lib/_getShortService')(DOMAIN?)

HTTP Codes

When dealing with the API, you will find a code property on most errors.

Command Access Levels

Magic Functions

If a script exports the following functions, they will be run at the respective run level

Knex Migrations

This project is powered by knexjs and takes advantage of its migration system. In order to use migrations npm install -g knex and use the knex command, e.g. knex migrate:make add_users_table. More instructions can be found here. The bot will check for and install new migrations on startup.

Have questions? Looking to chat? Join us on #fsociety on irc.freenode.net

Pull Requests Welcome

Suggested Utils