- Table of contents
- Setup
- API
- List of current functions
- Why nBot
nBot requires both Node.js >= 0.10
and MongoDB >= 2.4
to be installed in order to work.
- 1: Clone repository
- 2: Enter repository
- 3: Type
npm install
- 4: That's it!
To start bot up you need to create two files in config
directory: bot.js
and oAuth.js
. To simplify the process, config
directory already has example.bot.js
file and example.oAuth.js
file that you only need to copy and slightly modify for your own use. Remember though, that oAuth.js
is required, even if it will be just a just name-changed example file. Options names should be self-explanatory, but for the sake of README, I'll list them anyways.
{irc}
Options used by node-irc library on top whichnBot
is built on. For list of available options visit node-irc documentation{options}
Options object used bynBot
itself, not required options are commented and prepended with*
commandCharacter
character (or string) on which if found the bot will execute commandsdefaultLang
default language for command descriptions{urlScrapeTitle}
Object with configuration options for urlScrapingbegin
String prepended to the titlerepost
String prepended to user's nickname that posted link for the first time
root
Your irc nickname - used for creation of database document withroot
permissions{database}
Object with database configuration optionstype
Databasetype
, currently the only supported ismongodb
url
Database connection string*user
- Database user*password
Database password
The nBot
is built with an idea to easily extend his current public methods amount. At the moment nBot
has an impressive amount of 22 public methods (private module for eval included) and 4 private methods.
Adding new method is as easy as copying example.method
file in api
directory and adding your own functionality to the method
variable. In the end save your file anywhere in api directory with filename same as call method for users.
- Copy
api/example.method
anywhere toapi
folder and rename it toyourNewMethod.js
. - Add your logic into
method
variable. - Change command's
defaults
:description
,aliases
andlevel
- Create docstring for your command
- Write test (or not) for your new command.
- If you'll somehow need private module for your functionality, feel free to create it by prepending
__
to it's name - it will be skipped on bot's startup. - That's it! New command will be automatically loaded on next bot's startup.
8ball
Returns 8ballish posibility of provided actionevaluate
Evaluates provided string in virtual machine enviroment in forked processalias
Returns all aliases for provided commandcatapi
Returns a link to random cat picture using catapidice
Returns called dice throws.google
Returns first google result for provided stringhelp
Returns help for provided commandlist
Lists all currently available methodslmgtfy
Shows link to Let Me Google This For You querymemo
Creates memo for auser
.message
Sends private message to auser
pick
Returns pick order of provided strings.say
Says the provided strings.seen
Returns date whenuser
was last seen.shout
Shouts the provided string using FIGLET
invite
Invites user to current channelkick
Kicks user from current channeltopic
Changes current channel's topicuser
Users configuration collective command
I always really wanted to create an easily extandable irc bot that can be forked and hacked on by beginners. Right not the code isn't really tested, but it works well and is quite safe.