Skip to content
This repository was archived by the owner on May 16, 2022. It is now read-only.

Classes: Module

5GameMaker edited this page Jun 4, 2021 · 1 revision

abstract class Module extends Plugin

/plugins/Module.ts

import { Module, Bot, Command } from 'openjsk';

export class MyCoolModule extends Module {
    public constructor(bot : Bot) {
        super(bot);

        this.addCommand(new Command({
            name: "hello",
            executable: ctx => ctx.channel.send("Hello world");
        }));
    }
}

Plugin with commands

Methods

  • protected void addCommand(command : Command)

Add a command to your module

export class MyCoolModule extends Module {
    public constructor(bot : Bot) {
        super(bot);

        this.addCommand(new Command({
            name: "hello",
            executable: ctx => ctx.channel.send("Hello world");
        }));
    }
}

Clone this wiki locally