Giter VIP home page Giter VIP logo

so-chatbot's Introduction

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. For some tips on handling the bot, see Bot Handling.

If you wish, you can also run it headlessly on top of phantomjs and node:

  • Install phantomjs 2 (yes, it has to be 2 and above). Differs from platform to platform.
  • Install nightmare: npm install nightmare
  • Edit your credentials into run-headless.js
  • Hit the road: env DEBUG=nightmare node run-headless.js

Building

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

# linting
npm run lint

# building
$ node build.js
# or
$ npm run build

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

The provided publi.sh automagically does building, adds all changed items to commit and publishes for you:

$ ./publi.sh commit-message

The Bot API

(, a very short explanation of a limited subset of)

For a real cover, check the source code or this wiki page 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
);

so-chatbot's People

Contributors

5pitf1re avatar amaanc avatar awalgarg avatar benjamingr avatar bobvul avatar canop avatar erikroyall avatar incognito avatar jimmyhoffa avatar jsdelivrbot avatar kendfrey avatar petkaantonov avatar ralt avatar retsam avatar rlemon avatar schas002 avatar shmiddty avatar somekittens avatar teward avatar the-quill avatar zirak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.