I created this because starting from scratch for every bot you make sort of sucks so I wanted a base to build off of.
Create a file in your
commands
folder, which is specified byClient#loadCommands(dir);
, and fill it like so:
import Command from "path/to/structures/folder/in/src";
export default class PascalCaseName {
constructor(client:Client) {
super(client, {
help: {
name: "commandname",
description: "Description of the command.",
category: "category shown in help"
},
conf: {
perms: {
user: ["ADMINISTRATOR"],
bot: ["SEND_MESSAGES", "EMBED_LINKS"]
},
aliases: []
}
});
}
async run(message:Message, args:string[]):Promise<void> {
const embed = this.buildEmbed().setDescription(`Your arguments were: ${args.join(", ")}`);
await message.channel.send(embed);
return;
}
}
Create a file in your
events
folder, which is specified byClient#loadEvents(dir);
, and fill it like so, but with your own event:
import Event from "path/to/structures/folder/in/src";
import chalk from "chalk";
export default class Ready extends Event {
constructor(client:Client) {
super(client, "ready");
}
async run():Promise<void> {
this.client.log(`Bot started under ${this.client.user.tag}.`, "startup", chalk.rgb(75,255,100));
return;
}
}