@ayanaware/bentocord
Version:
Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.
63 lines • 2.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bentocord = void 0;
require("reflect-metadata");
const BentocordInterface_1 = require("./BentocordInterface");
const BentocordVariable_1 = require("./BentocordVariable");
const CommandManager_1 = require("./commands/CommandManager");
const HelpManager_1 = require("./commands/HelpManager");
const SlashManager_1 = require("./commands/SlashManager");
const Advanced_1 = require("./commands/builtin/Advanced");
const Bento_1 = require("./commands/builtin/Bento");
const Ping_1 = require("./commands/builtin/Ping");
const Prefix_1 = require("./commands/builtin/Prefix");
const SetAvatar_1 = require("./commands/builtin/SetAvatar");
const SetGame_1 = require("./commands/builtin/SetGame");
const Slash_1 = require("./commands/builtin/Slash");
const ComponentsManager_1 = require("./components/ComponentsManager");
const Discord_1 = require("./discord/Discord");
const PromptManager_1 = require("./prompt/PromptManager");
const Reply_1 = require("./prompt/commands/Reply");
class Bentocord {
constructor() {
this.name = '@ayanaware/bentocord';
try {
// ESLint Hates him, check out this one weird trick
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires, import/extensions
const { version } = require('../package.json');
this.version = version || 'Error';
}
catch (e) {
this.version = 'Error';
}
}
async onLoad() {
const entityManager = this.api.getBento().entities;
// Load BentocordInterface
await entityManager.addPlugin(BentocordInterface_1.BentocordInterface);
await entityManager.addComponents([
Discord_1.Discord,
PromptManager_1.PromptManager,
CommandManager_1.CommandManager,
ComponentsManager_1.ComponentsManager,
SlashManager_1.SlashManager,
HelpManager_1.HelpManager,
Reply_1.ReplyCommand,
]);
// Load built-in commands
const loadBuiltin = this.api.getVariable({ name: BentocordVariable_1.BentocordVariable.BENTOCORD_BUILTIN_COMMANDS, default: true });
if (!loadBuiltin)
return;
await entityManager.addComponents([
Advanced_1.AdvancedCommand,
Bento_1.BentoCommand,
Ping_1.PingCommand,
Prefix_1.PrefixCommand,
SetAvatar_1.SetAvatarCommand,
SetGame_1.SetGameCommand,
Slash_1.SlashCommand,
]);
}
}
exports.Bentocord = Bentocord;
//# sourceMappingURL=Bentocord.js.map