Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

160 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

For usage info, on how to use the bot, see here.

###Running the bot### The bot is currently a big dangle-on script running in your browser. Run bookmarklet.js in your browser to get it up an' running.

###Building### (For build minification, install uglify-js2)

#one must first get the repo
$ git clone git://github.com/Zirak/SO-ChatBot.git
$ cd SO-ChatBot

#to build something
$ node build.js
#or, to, skip minification
$ node build.js no-min
#or, to not add the adapter
$ node build.js no-adapter
#you can combine the two options above in whichever order

The result will be in master.js and master.min.js

###The Bot API### (or a very limited subset of) For a real cover, check the source code or console.log(bot). Should be straightforward.

//add a bot command
bot.addCommand({
    name : 'command_name',
    fun : commandFunction,

    //permissions object (can be ommitted for all-can-use, all-can-del)
    permissions : {
        use : 'NONE' /*or*/ 'ALL' /*or*/ [array of usrids],
        del : 'NONE' /*or*/ 'ALL' /*or*/ [array of usrids]
    },

    //whether the command is asynchronous or not (default false)
    async : true /*or*/ false
});

//add a listening regex and a corresponding callback
bot.listen(
    //regular expression or array of regular expressions
    pattern,

    callbackFun
);

Callbacks receive a single paramete, the arguments, unless they're asynchronous, in which case they receive 2 (the second being a callback to optionally use.)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages