1.2.0 • Published 6 years ago

klasy-eris v1.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

klasy-eris

A lightweight bot framework built around Eris.

npm version

Creating a bot

klasy-eris is simple to use and a bot can be created in just a few lines.

const Klasy = require("klasy-eris");
const path = require("path");
const client = new Klasy.Client({
	token: "token",
	commandPath: path.join(__dirname, "commands"),
  eventPath: path.join(__dirname, "events"),
  ownerID: "id"
}).start();

Creating a command

Klasy commands are simple to make and have a few options on how you want your command to be used. See the docs for more information.

IMPORTANT: klasy-eris comes with a ping, help, eval and prefix command already. To modify it, edit the source. This will be different in the future!

const { Command } = require("klasy-eris");

module.exports = class Example extends Command {
  constructor(client) {
    super(client, {
      name: "example",
    });
  }

  async run(message, params) {
    message.channel.createMessage("hello!");
  }
};

Creating an event

Klasy events are simple to make and can be done in just a few minutes. See the docs for more information.

IMPORTANT: klasy-eris comes with a ready event already. To modify it, edit the source. This will be different in the future.

const { Event } = require("klasy-eris");

module.exports = class Example extends Event {
  constructor(client) {
    super(client, "ready");
  }

  async run() {
    console.log("example ready event!");
  }
};