0.5.2 • Published 7 years ago

isic v0.5.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

isic

A modular Discord bot.

Usage

You can either clone this directory and run the bot via npm start or install the isic package via npm install isic.

Use isic as a package

You can use isic as a npm package:

const {Bot} = require("isic")

let bot = new Bot({discordToken: "YOUR_DISCORD_TOKEN"})

// after bot is ready
bot.on("setup", () => {

    // add your own commands
    bot.command("test", (res, args) => {
        res.send("This is a test!")
    })
})

Module structure

Your module directory should look like this:

modules/
    helloworld/
        module.json
        helloworld.js

Example for module.json:

{
    "ident": "github.atomicptr.HelloWorld",
    "main": "helloworld.js"
}

Example for helloworld.js:

module.exports = function(bot) {

    bot.command("hello", (res, args) => {
        let name = "World"

        if(args.length > 0) {
            name = args.join(" ")
        }

        res.reply(`Hello, ${name}!`).then(message => {
            if(res.canI("ADD_REACTIONS")) {
                message.react("😁")
            }
        })
    })
}

License

MIT

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago