xernerx 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/build/ContextCommandBuilder.d.ts +68 -0
  3. package/dist/cjs/build/ContextCommandBuilder.js +97 -0
  4. package/dist/cjs/build/EventBuilder.d.ts +21 -0
  5. package/dist/cjs/build/EventBuilder.js +44 -0
  6. package/dist/cjs/build/InhibitorBuilder.d.ts +19 -0
  7. package/dist/cjs/build/InhibitorBuilder.js +37 -0
  8. package/dist/cjs/build/MessageCommandBuilder.d.ts +59 -0
  9. package/dist/cjs/build/MessageCommandBuilder.js +100 -0
  10. package/dist/cjs/build/SlashCommandBuilder.d.ts +64 -0
  11. package/dist/cjs/build/SlashCommandBuilder.js +168 -0
  12. package/dist/cjs/client/XernerxClient.d.ts +28 -0
  13. package/dist/cjs/client/XernerxClient.js +116 -0
  14. package/dist/cjs/handlers/CommandHandler.d.ts +27 -0
  15. package/dist/cjs/handlers/CommandHandler.js +45 -0
  16. package/dist/cjs/handlers/EventHandler.d.ts +13 -0
  17. package/dist/cjs/handlers/EventHandler.js +19 -0
  18. package/dist/cjs/handlers/Handler.d.ts +57 -0
  19. package/dist/cjs/handlers/Handler.js +308 -0
  20. package/dist/cjs/handlers/InhibitorHandler.d.ts +18 -0
  21. package/dist/cjs/handlers/InhibitorHandler.js +24 -0
  22. package/dist/cjs/main.d.ts +44 -0
  23. package/dist/cjs/main.js +112 -0
  24. package/dist/cjs/models/CommandArguments.d.ts +17 -0
  25. package/dist/cjs/models/CommandArguments.js +106 -0
  26. package/dist/cjs/models/Events.d.ts +24 -0
  27. package/dist/cjs/models/Events.js +307 -0
  28. package/dist/cjs/models/Extensions.d.ts +7 -0
  29. package/dist/cjs/models/Extensions.js +26 -0
  30. package/dist/cjs/tools/XernerxError.d.ts +5 -0
  31. package/dist/cjs/tools/XernerxError.js +11 -0
  32. package/dist/cjs/tools/package.d.ts +49 -0
  33. package/dist/cjs/tools/package.js +50 -0
  34. package/dist/cjs/types/enums.d.ts +44 -0
  35. package/dist/cjs/types/enums.js +38 -0
  36. package/dist/cjs/types/interfaces.d.ts +25 -0
  37. package/dist/cjs/types/interfaces.js +2 -0
  38. package/dist/cjs/types/options.d.ts +241 -0
  39. package/dist/cjs/types/options.js +2 -0
  40. package/dist/cjs/types/types.d.ts +61 -0
  41. package/dist/cjs/types/types.js +2 -0
  42. package/dist/cjs/utils/ClientUtil.d.ts +25 -0
  43. package/dist/cjs/utils/ClientUtil.js +211 -0
  44. package/dist/cjs/utils/CommandUtil.d.ts +58 -0
  45. package/dist/cjs/utils/CommandUtil.js +247 -0
  46. package/dist/cjs/validators/CommandValidations.d.ts +12 -0
  47. package/dist/cjs/validators/CommandValidations.js +169 -0
  48. package/dist/cjs/validators/InhibitorValidations.d.ts +11 -0
  49. package/dist/cjs/validators/InhibitorValidations.js +40 -0
  50. package/dist/main.d.ts +1 -1
  51. package/dist/main.js +1 -1
  52. package/dist/mjs/build/ContextCommandBuilder.d.ts +68 -0
  53. package/dist/mjs/build/ContextCommandBuilder.js +88 -0
  54. package/dist/mjs/build/EventBuilder.d.ts +21 -0
  55. package/dist/mjs/build/EventBuilder.js +34 -0
  56. package/dist/mjs/build/InhibitorBuilder.d.ts +19 -0
  57. package/dist/mjs/build/InhibitorBuilder.js +27 -0
  58. package/dist/mjs/build/MessageCommandBuilder.d.ts +59 -0
  59. package/dist/mjs/build/MessageCommandBuilder.js +90 -0
  60. package/dist/mjs/build/SlashCommandBuilder.d.ts +64 -0
  61. package/dist/mjs/build/SlashCommandBuilder.js +121 -0
  62. package/dist/mjs/client/XernerxClient.d.ts +28 -0
  63. package/dist/mjs/client/XernerxClient.js +108 -0
  64. package/dist/mjs/handlers/CommandHandler.d.ts +27 -0
  65. package/dist/mjs/handlers/CommandHandler.js +42 -0
  66. package/dist/mjs/handlers/EventHandler.d.ts +13 -0
  67. package/dist/mjs/handlers/EventHandler.js +16 -0
  68. package/dist/mjs/handlers/Handler.d.ts +57 -0
  69. package/dist/mjs/handlers/Handler.js +260 -0
  70. package/dist/mjs/handlers/InhibitorHandler.d.ts +18 -0
  71. package/dist/mjs/handlers/InhibitorHandler.js +21 -0
  72. package/dist/mjs/main.d.ts +44 -0
  73. package/dist/mjs/main.js +52 -0
  74. package/dist/mjs/models/CommandArguments.d.ts +17 -0
  75. package/dist/mjs/models/CommandArguments.js +101 -0
  76. package/dist/mjs/models/Events.d.ts +24 -0
  77. package/dist/mjs/models/Events.js +295 -0
  78. package/dist/mjs/models/Extensions.d.ts +7 -0
  79. package/dist/mjs/models/Extensions.js +23 -0
  80. package/dist/mjs/tools/XernerxError.d.ts +5 -0
  81. package/dist/mjs/tools/XernerxError.js +8 -0
  82. package/dist/mjs/tools/package.d.ts +49 -0
  83. package/dist/mjs/tools/package.js +48 -0
  84. package/dist/mjs/types/enums.d.ts +44 -0
  85. package/dist/mjs/types/enums.js +35 -0
  86. package/dist/mjs/types/interfaces.d.ts +25 -0
  87. package/dist/mjs/types/interfaces.js +1 -0
  88. package/dist/mjs/types/options.d.ts +241 -0
  89. package/dist/mjs/types/options.js +1 -0
  90. package/dist/mjs/types/types.d.ts +61 -0
  91. package/dist/mjs/types/types.js +1 -0
  92. package/dist/mjs/utils/ClientUtil.d.ts +25 -0
  93. package/dist/mjs/utils/ClientUtil.js +202 -0
  94. package/dist/mjs/utils/CommandUtil.d.ts +58 -0
  95. package/dist/mjs/utils/CommandUtil.js +232 -0
  96. package/dist/mjs/validators/CommandValidations.d.ts +12 -0
  97. package/dist/mjs/validators/CommandValidations.js +166 -0
  98. package/dist/mjs/validators/InhibitorValidations.d.ts +11 -0
  99. package/dist/mjs/validators/InhibitorValidations.js +36 -0
  100. package/dist/tools/XernerxLog.js +1 -1
  101. package/package.json +1 -1
@@ -0,0 +1,168 @@
1
+ 'use strict';
2
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? function (o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = {
10
+ enumerable: true,
11
+ get: function () {
12
+ return m[k];
13
+ },
14
+ };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }
18
+ : function (o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ });
22
+ var __setModuleDefault =
23
+ (this && this.__setModuleDefault) ||
24
+ (Object.create
25
+ ? function (o, v) {
26
+ Object.defineProperty(o, 'default', { enumerable: true, value: v });
27
+ }
28
+ : function (o, v) {
29
+ o['default'] = v;
30
+ });
31
+ var __importStar =
32
+ (this && this.__importStar) ||
33
+ function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k in mod) if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ var __importDefault =
41
+ (this && this.__importDefault) ||
42
+ function (mod) {
43
+ return mod && mod.__esModule ? mod : { default: mod };
44
+ };
45
+ Object.defineProperty(exports, '__esModule', { value: true });
46
+ const discord_js_1 = __importStar(require('discord.js'));
47
+ const zod_1 = require('zod');
48
+ const XernerxError_js_1 = __importDefault(require('../tools/XernerxError.js'));
49
+ const XernerxClient_js_1 = __importDefault(require('../client/XernerxClient.js'));
50
+ /**
51
+ * @description - The command builder for slash commands.
52
+ * @param {String} id - The unique ID of the command.
53
+ * @param {SlashCommandOptions} options - The command options.
54
+ */
55
+ class SlashCommandBuilder {
56
+ id;
57
+ data;
58
+ name;
59
+ description;
60
+ info;
61
+ category;
62
+ channelType;
63
+ cooldown;
64
+ ignore;
65
+ strict;
66
+ permissions;
67
+ args;
68
+ subcommands;
69
+ groups;
70
+ defer;
71
+ client;
72
+ constructor(id, options) {
73
+ this.id = id;
74
+ this.data = new discord_js_1.default.SlashCommandBuilder().setName(options.name).setDescription(options.description);
75
+ if (options.args && options?.args?.length > 0) {
76
+ this.addArgs(this.data, options.args);
77
+ }
78
+ if (options.subcommands && options?.subcommands?.length > 0) {
79
+ this.addSubcommands(this.data, options.subcommands);
80
+ }
81
+ if (options.groups && options?.groups?.length > 0) {
82
+ this.addSubcommandGroups(options.groups);
83
+ }
84
+ zod_1.z
85
+ .object({
86
+ description: zod_1.z.string(),
87
+ info: zod_1.z.string(),
88
+ category: zod_1.z.string(),
89
+ channelType: zod_1.z.array(zod_1.z.number()).or(zod_1.z.number()),
90
+ cooldown: zod_1.z.number(),
91
+ ignore: zod_1.z.object({
92
+ owner: zod_1.z.boolean(),
93
+ users: zod_1.z.array(zod_1.z.string()),
94
+ channels: zod_1.z.array(zod_1.z.string()),
95
+ guilds: zod_1.z.array(zod_1.z.string()),
96
+ }),
97
+ strict: zod_1.z.object({
98
+ owner: zod_1.z.boolean(),
99
+ users: zod_1.z.array(zod_1.z.string()),
100
+ channels: zod_1.z.array(zod_1.z.string()),
101
+ guilds: zod_1.z.array(zod_1.z.string()),
102
+ }),
103
+ permissions: zod_1.z.object({
104
+ client: zod_1.z.array(zod_1.z.string()),
105
+ users: zod_1.z.array(zod_1.z.string()),
106
+ dm: zod_1.z.boolean(),
107
+ }),
108
+ defer: zod_1.z.object({
109
+ reply: zod_1.z.boolean(),
110
+ ephemeral: zod_1.z.boolean(),
111
+ fetch: zod_1.z.boolean(),
112
+ }),
113
+ })
114
+ .deepPartial()
115
+ .parse(options);
116
+ this.name = options.name;
117
+ this.description = options.description;
118
+ this.info = options.info;
119
+ this.category = options.category;
120
+ this.channelType = options.channelType;
121
+ this.cooldown = options.cooldown;
122
+ this.ignore = options.ignore;
123
+ this.strict = options.strict;
124
+ this.permissions = options.permissions;
125
+ this.defer = options.defer;
126
+ this.client = XernerxClient_js_1.default;
127
+ }
128
+ /**
129
+ * TODO - update description
130
+ * @param interaction
131
+ */
132
+ async conditions(interaction) {}
133
+ /**
134
+ * TODO - update description
135
+ * @param interaction
136
+ */
137
+ async exec(interaction) {}
138
+ addArgs(command, args) {
139
+ const types = ['boolean', 'integer', 'number', 'string', 'user', 'role', 'channel', 'mentionable'];
140
+ for (const argument of args) {
141
+ if (!types.includes(argument.type.toLowerCase())) throw new XernerxError_js_1.default(`Expected one of ${types.join(', ')}, received ${argument.type} instead.`);
142
+ let slashArgumentType = `${argument.type.slice(0, 1).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;
143
+ command[`add${slashArgumentType}Option`]((option) => {
144
+ option
145
+ .setName(argument.name)
146
+ .setDescription(argument.description)
147
+ .setRequired(argument.required || false);
148
+ if (argument.choices) option.setChoices(...argument?.choices);
149
+ return option;
150
+ });
151
+ }
152
+ }
153
+ addSubcommands(method, subcommands) {
154
+ for (const subcommand of subcommands) {
155
+ let sub = new discord_js_1.SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);
156
+ if (subcommand.args?.length > 0) this.addArgs(sub, subcommand.args);
157
+ method.addSubcommand(sub);
158
+ }
159
+ }
160
+ addSubcommandGroups(groups) {
161
+ for (const group of groups) {
162
+ let subcommandGroup = new discord_js_1.SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);
163
+ if (group.subcommands?.length > 0) this.addSubcommands(subcommandGroup, group.subcommands);
164
+ this.data.addSubcommandGroup(subcommandGroup);
165
+ }
166
+ }
167
+ }
168
+ exports.default = SlashCommandBuilder;
@@ -0,0 +1,28 @@
1
+ import { Client, Collection } from 'discord.js';
2
+ import ExtensionBuilder from 'xernerx-extension-builder';
3
+ import { ClientUtil } from '../utils/ClientUtil.js';
4
+ import { ClientOptions, DiscordOptions, ExtensionOptions, HandlerOptions } from '../types/options.js';
5
+ import { ClientCache, ClientCommands, ClientModules } from '../types/interfaces.js';
6
+ import EventBuilder from '../build/EventBuilder.js';
7
+ import InhibitorBuilder from '../build/InhibitorBuilder.js';
8
+ /**
9
+ * @description - The Client.
10
+ * @param {DiscordOptions} discordOptions - The options for discord.js.
11
+ * @param {ClientOptions} clientOptions - The options for the Xernerx Client.
12
+ * @extends {Client}
13
+ */
14
+ export default class XernerxClient extends Client {
15
+ settings: ClientOptions;
16
+ commands: ClientCommands;
17
+ cache: ClientCache;
18
+ modules: ClientModules;
19
+ util: ClientUtil;
20
+ handlerOptions: HandlerOptions;
21
+ events: Collection<string, EventBuilder>;
22
+ extensions: Record<string, ExtensionBuilder>;
23
+ inhibitors: Collection<string, InhibitorBuilder>;
24
+ config: object;
25
+ constructor(discordOptions: DiscordOptions, clientOptions: ClientOptions, config?: object);
26
+ register(token: string): void;
27
+ loadAllExtensions(options: ExtensionOptions): Promise<void>;
28
+ }
@@ -0,0 +1,116 @@
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+ const discord_js_1 = require('discord.js');
9
+ const zod_1 = require('zod');
10
+ const dumfunctions_1 = require('dumfunctions');
11
+ const ClientUtil_js_1 = require('../utils/ClientUtil.js');
12
+ const CommandHandler_js_1 = __importDefault(require('../handlers/CommandHandler.js'));
13
+ const EventHandler_js_1 = __importDefault(require('../handlers/EventHandler.js'));
14
+ const InhibitorHandler_js_1 = __importDefault(require('../handlers/InhibitorHandler.js'));
15
+ const Extensions_js_1 = __importDefault(require('../models/Extensions.js'));
16
+ // TODO - Add commandNotFound as an event to the client.
17
+ /**
18
+ * @description - The Client.
19
+ * @param {DiscordOptions} discordOptions - The options for discord.js.
20
+ * @param {ClientOptions} clientOptions - The options for the Xernerx Client.
21
+ * @extends {Client}
22
+ */
23
+ class XernerxClient extends discord_js_1.Client {
24
+ settings;
25
+ commands;
26
+ cache;
27
+ modules;
28
+ util;
29
+ handlerOptions;
30
+ events;
31
+ extensions;
32
+ inhibitors;
33
+ config;
34
+ constructor(discordOptions, clientOptions, config) {
35
+ super(discordOptions);
36
+ this.settings = zod_1.z
37
+ .object({
38
+ ownerId: zod_1.z.string().or(zod_1.z.array(zod_1.z.string())).default([]),
39
+ permissions: zod_1.z
40
+ .object({
41
+ client: zod_1.z.array(zod_1.z.string()).default([]),
42
+ user: zod_1.z.array(zod_1.z.string()).default([]),
43
+ dm: zod_1.z.boolean().default(false),
44
+ })
45
+ .optional(),
46
+ ignore: zod_1.z
47
+ .object({
48
+ owner: zod_1.z.boolean().default(false),
49
+ users: zod_1.z.array(zod_1.z.string()),
50
+ channels: zod_1.z.array(zod_1.z.string()),
51
+ guilds: zod_1.z.array(zod_1.z.string()),
52
+ })
53
+ .optional(),
54
+ log: zod_1.z
55
+ .object({
56
+ ready: zod_1.z.boolean().default(false),
57
+ error: zod_1.z.boolean().default(false),
58
+ })
59
+ .optional(),
60
+ cooldown: zod_1.z
61
+ .object({
62
+ command: zod_1.z.number().default(0),
63
+ cache: zod_1.z.number().default(0),
64
+ })
65
+ .optional(),
66
+ })
67
+ .parse(clientOptions);
68
+ this.config = config || {};
69
+ this.commands = {
70
+ message: new discord_js_1.Collection(),
71
+ slash: new discord_js_1.Collection(),
72
+ context: new discord_js_1.Collection(),
73
+ };
74
+ this.events = new discord_js_1.Collection();
75
+ this.inhibitors = new discord_js_1.Collection();
76
+ this.cache = {
77
+ messages: new discord_js_1.Collection(),
78
+ cooldowns: new discord_js_1.Collection(),
79
+ messageCommands: new discord_js_1.Collection(),
80
+ slashCommands: new discord_js_1.Collection(),
81
+ contextCommands: new discord_js_1.Collection(),
82
+ commands: new discord_js_1.Collection(),
83
+ };
84
+ this.modules = {
85
+ commandHandler: new CommandHandler_js_1.default(this),
86
+ eventHandler: new EventHandler_js_1.default(this),
87
+ inhibitorHandler: new InhibitorHandler_js_1.default(this),
88
+ };
89
+ this.extensions = {};
90
+ this.util = new ClientUtil_js_1.ClientUtil(this);
91
+ this.handlerOptions = {};
92
+ if (this.settings?.log?.ready) {
93
+ this.once('ready', async (client) => {
94
+ const size = (await client.guilds.fetch()).size;
95
+ console.info(
96
+ dumfunctions_1.Style.log(
97
+ `Xernerx | ${client.user.tag} signed in watching ${size} server${size > 1 ? 's' : ''}. ${
98
+ (this.handlerOptions.slash || this.handlerOptions.context)?.guildId
99
+ ? `Using ${(await this.guilds.fetch((this.handlerOptions.slash || this.handlerOptions.context)?.guildId || '0')).name} as local guild.`
100
+ : ''
101
+ }`,
102
+ { color: dumfunctions_1.Style.TextColor.Purple }
103
+ )
104
+ );
105
+ });
106
+ }
107
+ }
108
+ register(token) {
109
+ this.login(token);
110
+ }
111
+ loadAllExtensions(options) {
112
+ const extensions = new Extensions_js_1.default(this);
113
+ return extensions.load(options.extensions, options.logging || false);
114
+ }
115
+ }
116
+ exports.default = XernerxClient;
@@ -0,0 +1,27 @@
1
+ import XernerxClient from '../client/XernerxClient.js';
2
+ import { Handler } from './Handler.js';
3
+ import { ContextCommandHandlerOptions, MessageCommandHandlerOptions, SlashCommandHandlerOptions } from '../types/options.js';
4
+ /**
5
+ * @description - The command handler.
6
+ * @param {XernerxClient} client - The XernerxClient.
7
+ */
8
+ export default class CommandHandler {
9
+ client: XernerxClient;
10
+ handler: Handler;
11
+ constructor(client: XernerxClient);
12
+ /**
13
+ * @description - The message command loader.
14
+ * @param {MessageCommandOptions} options - message command loader options.
15
+ */
16
+ loadAllMessageCommands(options: MessageCommandHandlerOptions): void;
17
+ /**
18
+ * @description - The slash command loader.
19
+ * @param {SlashCommandOptions} options - slash command loader options.
20
+ */
21
+ loadAllSlashCommands(options: SlashCommandHandlerOptions): void;
22
+ /**
23
+ * @description - The context command loader.
24
+ * @param {ContextCommandOptions} options - context command loader options.
25
+ */
26
+ loadAllContextCommands(options: ContextCommandHandlerOptions): void;
27
+ }
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ const Handler_js_1 = require('./Handler.js');
4
+ const Events_js_1 = require('../models/Events.js');
5
+ /**
6
+ * @description - The command handler.
7
+ * @param {XernerxClient} client - The XernerxClient.
8
+ */
9
+ class CommandHandler {
10
+ client;
11
+ handler;
12
+ constructor(client) {
13
+ this.client = client;
14
+ this.handler = new Handler_js_1.Handler(client);
15
+ new Events_js_1.CommandsDeploy(this.client).deploy();
16
+ }
17
+ /**
18
+ * @description - The message command loader.
19
+ * @param {MessageCommandOptions} options - message command loader options.
20
+ */
21
+ loadAllMessageCommands(options) {
22
+ this.handler.loadAllMessageCommands(options);
23
+ const events = new Events_js_1.MessageCommandEvents(this.client);
24
+ events.messageCreate();
25
+ events.messageUpdate();
26
+ events.messageDelete();
27
+ }
28
+ /**
29
+ * @description - The slash command loader.
30
+ * @param {SlashCommandOptions} options - slash command loader options.
31
+ */
32
+ loadAllSlashCommands(options) {
33
+ this.handler.loadAllSlashCommands(options);
34
+ new Events_js_1.SlashCommandEvents(this.client).slashCreate();
35
+ }
36
+ /**
37
+ * @description - The context command loader.
38
+ * @param {ContextCommandOptions} options - context command loader options.
39
+ */
40
+ loadAllContextCommands(options) {
41
+ this.handler.loadAllContextCommands(options);
42
+ new Events_js_1.ContextCommandEvents(this.client).contextCreate();
43
+ }
44
+ }
45
+ exports.default = CommandHandler;
@@ -0,0 +1,13 @@
1
+ import XernerxClient from '../client/XernerxClient.js';
2
+ import { EventHandlerOptions } from '../types/options.js';
3
+ import { Handler } from './Handler.js';
4
+ export default class EventHandler {
5
+ client: XernerxClient;
6
+ handler: Handler;
7
+ constructor(client: XernerxClient);
8
+ /**
9
+ * @description - The event loader
10
+ * @param {EventLoadOptions} options - message command options
11
+ */
12
+ loadAllEvents(options: EventHandlerOptions): void;
13
+ }
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ const Handler_js_1 = require('./Handler.js');
4
+ class EventHandler {
5
+ client;
6
+ handler;
7
+ constructor(client) {
8
+ this.client = client;
9
+ this.handler = new Handler_js_1.Handler(client);
10
+ }
11
+ /**
12
+ * @description - The event loader
13
+ * @param {EventLoadOptions} options - message command options
14
+ */
15
+ loadAllEvents(options) {
16
+ return this.handler.loadAllEvents(options);
17
+ }
18
+ }
19
+ exports.default = EventHandler;
@@ -0,0 +1,57 @@
1
+ import XernerxClient from '../client/XernerxClient.js';
2
+ import { ContextCommandHandlerOptions, EventHandlerOptions, InhibitorHandlerOptions, MessageCommandHandlerOptions, SlashCommandHandlerOptions } from '../types/options.js';
3
+ /**
4
+ * @description - The Handler class.
5
+ * @param {XernerxClient} client - The XernerxClient.
6
+ */
7
+ export declare class Handler {
8
+ private client;
9
+ commands: object[];
10
+ readyTimestamp: number;
11
+ constructor(client: XernerxClient);
12
+ /**
13
+ * @description - The loader for the message commands.
14
+ * @param {MessageCommandOptions} options - The options for the message command loader.
15
+ */
16
+ loadAllMessageCommands(options: MessageCommandHandlerOptions): void;
17
+ /**
18
+ * @description - The loader for the slash commands.
19
+ * @param {SlashCommandOptions} options - The options for the slash command loader.
20
+ */
21
+ loadAllSlashCommands(options: SlashCommandHandlerOptions): void;
22
+ /**
23
+ * @description - The loader for the context commands.
24
+ * @param {ContextCommandOptions} options - The options for the context command loader.
25
+ */
26
+ loadAllContextCommands(options: ContextCommandHandlerOptions): void;
27
+ /**
28
+ * @description - The loader for the events.
29
+ * @param {EventLoadOptions} options - The options for the event loader.
30
+ */
31
+ loadAllEvents(options: EventHandlerOptions): void;
32
+ /**
33
+ * @description - The loader for the inhibitors.
34
+ * @param {InhibitorLoadOptions} options - The options for the inhibitor loader.
35
+ */
36
+ loadAllInhibitors(options: InhibitorHandlerOptions): void;
37
+ /**
38
+ * @description - a reader for directories
39
+ * @param {string} dir - the directory to look for.
40
+ * @returns array of files.
41
+ */
42
+ private readdir;
43
+ /**
44
+ * @description file loader.
45
+ * @param {string} dir - the directory.
46
+ * @param {string} file - the file in the directory.
47
+ * @param {string} type - the type of file.
48
+ * @returns undefined
49
+ */
50
+ private load;
51
+ /**
52
+ * @description the event emitter to emit all events.
53
+ * @param {object} event - the event to be emitted.
54
+ * @returns void
55
+ */
56
+ private emitter;
57
+ }