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 | require("./override");
|
14 |
|
15 |
|
16 |
|
17 | class Application {
|
18 | constructor(options) {
|
19 | this.options = options;
|
20 | Constants_1.default.applyPatches({
|
21 | COMMAND_PREFIX: options.commandPrefix,
|
22 | ERROR_RENDER_FORMAT: options.errorFormat
|
23 | });
|
24 | }
|
25 | |
26 |
|
27 |
|
28 | async init() {
|
29 | this.client = this.options.client || new discord_js_1.Client();
|
30 | this.client.botkit = this;
|
31 | if (!this.client.readyTimestamp) {
|
32 | await this.client.login(this.options.token);
|
33 | }
|
34 | this.commandSystem = new commands_1.default({ directory: this.options.commandDirectory, app: this, preloadExclude: this.options.preloadExclude, automaticCategoryNames: this.options.automaticCategoryNames });
|
35 | await this.commandSystem.init();
|
36 | }
|
37 | }
|
38 | exports.Application = Application;
|
39 | exports.default = Application;
|
40 | __export(require("./commands"));
|
41 | exports.Constants = Constants_1.default;
|
42 | __export(require("./db"));
|
43 | __export(require("./modules"));
|
44 | __export(require("./util"));
|
45 |
|
\ | No newline at end of file |