1 | "use strict";
|
2 | function __export(m) {
|
3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
4 | }
|
5 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
6 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
7 | };
|
8 | Object.defineProperty(exports, "__esModule", { value: true });
|
9 | const discord_js_1 = require("discord.js");
|
10 | const commands_1 = __importDefault(require("./commands"));
|
11 | const Constants_1 = __importDefault(require("./Constants"));
|
12 | require("./node-additions");
|
13 |
|
14 |
|
15 |
|
16 | class Application {
|
17 | constructor(options) {
|
18 | this.options = options;
|
19 | Constants_1.default.applyPatches({
|
20 | COMMAND_PREFIX: options.commandPrefix,
|
21 | ERROR_RENDER_FORMAT: options.errorFormat
|
22 | });
|
23 | }
|
24 | |
25 |
|
26 |
|
27 | async init() {
|
28 | this.client = this.options.client || new discord_js_1.Client();
|
29 | this.client.botkit = this;
|
30 | if (!this.client.readyTimestamp) {
|
31 | await this.client.login(this.options.token);
|
32 | }
|
33 | this.commandSystem = new commands_1.default({
|
34 | directory: this.options.commandDirectory,
|
35 | app: this,
|
36 | preloadExclude: this.options.preloadExclude,
|
37 | automaticCategoryNames: this.options.automaticCategoryNames,
|
38 | globalGuards: this.options.globalGuards
|
39 | });
|
40 | await this.commandSystem.init();
|
41 | }
|
42 | }
|
43 | exports.Application = Application;
|
44 | exports.default = Application;
|
45 | __export(require("./commands"));
|
46 | exports.Constants = Constants_1.default;
|
47 | __export(require("./db"));
|
48 | __export(require("./modules"));
|
49 | __export(require("./util"));
|
50 |
|
\ | No newline at end of file |