Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

atomicptr/isic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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