Classes: Module - 5GameMaker/openjsk GitHub Wiki
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");
}));
}
}