xernerx 3.4.3 → 3.5.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.
- package/README.md +10 -10
- package/dist/build/ContextCommandBuilder.d.ts +60 -42
- package/dist/build/ContextCommandBuilder.js +93 -86
- package/dist/build/EventBuilder.d.ts +21 -17
- package/dist/build/EventBuilder.js +34 -35
- package/dist/build/InhibitorBuilder.d.ts +19 -20
- package/dist/build/InhibitorBuilder.js +27 -27
- package/dist/build/MessageCommandBuilder.d.ts +53 -42
- package/dist/build/MessageCommandBuilder.js +90 -78
- package/dist/build/SlashCommandBuilder.d.ts +58 -40
- package/dist/build/SlashCommandBuilder.js +125 -118
- package/dist/client/XernerxClient.d.ts +28 -28
- package/dist/client/XernerxClient.js +101 -83
- package/dist/handlers/CommandHandler.d.ts +27 -27
- package/dist/handlers/CommandHandler.js +42 -42
- package/dist/handlers/EventHandler.d.ts +13 -13
- package/dist/handlers/EventHandler.js +16 -16
- package/dist/handlers/Handler.d.ts +57 -57
- package/dist/handlers/Handler.js +250 -250
- package/dist/handlers/InhibitorHandler.d.ts +18 -18
- package/dist/handlers/InhibitorHandler.js +21 -21
- package/dist/main.cjs +2023 -0
- package/dist/main.d.ts +30 -30
- package/dist/main.js +42 -42
- package/dist/models/CommandArguments.d.ts +17 -17
- package/dist/models/CommandArguments.js +121 -123
- package/dist/models/Events.d.ts +24 -24
- package/dist/models/Events.js +294 -304
- package/dist/models/Extensions.d.ts +7 -7
- package/dist/models/Extensions.js +23 -23
- package/dist/tools/XernerxError.d.ts +5 -5
- package/dist/tools/XernerxError.js +8 -8
- package/dist/tools/package.d.ts +49 -38
- package/dist/tools/package.js +48 -41
- package/dist/types/enums.d.ts +35 -35
- package/dist/types/enums.js +35 -35
- package/dist/types/interfaces.d.ts +25 -25
- package/dist/types/interfaces.js +1 -1
- package/dist/types/options.d.ts +241 -206
- package/dist/types/options.js +1 -1
- package/dist/types/types.d.ts +34 -32
- package/dist/types/types.js +1 -1
- package/dist/utils/ClientUtil.d.ts +25 -25
- package/dist/utils/ClientUtil.js +222 -218
- package/dist/utils/CommandUtil.d.ts +56 -56
- package/dist/utils/CommandUtil.js +248 -260
- package/dist/validators/CommandValidations.d.ts +7 -7
- package/dist/validators/CommandValidations.js +183 -185
- package/dist/validators/InhibitorValidations.d.ts +11 -11
- package/dist/validators/InhibitorValidations.js +42 -42
- package/dist/validators/Shapes.js +1 -0
- package/package.json +54 -39
- package/dist/build/XContextCommandBuilder.d.ts +0 -40
- package/dist/build/XContextCommandBuilder.js +0 -84
- package/dist/build/XEventBuilder.d.ts +0 -17
- package/dist/build/XEventBuilder.js +0 -35
- package/dist/build/XInhibitorBuilder.d.ts +0 -20
- package/dist/build/XInhibitorBuilder.js +0 -28
- package/dist/build/XMessageCommandBuilder.d.ts +0 -42
- package/dist/build/XMessageCommandBuilder.js +0 -80
- package/dist/build/XSlashCommandBuilder.d.ts +0 -36
- package/dist/build/XSlashCommandBuilder.js +0 -114
- package/dist/models/CommandValidations.d.ts +0 -4
- package/dist/models/CommandValidations.js +0 -183
- package/dist/models/InhibitorValidations.d.ts +0 -12
- package/dist/models/InhibitorValidations.js +0 -42
|
@@ -1,83 +1,101 @@
|
|
|
1
|
-
import { Client, Collection } from 'discord.js';
|
|
2
|
-
import {
|
|
3
|
-
import { Style } from 'dumfunctions';
|
|
4
|
-
import { ClientUtil } from '../utils/ClientUtil.js';
|
|
5
|
-
import CommandHandler from '../handlers/CommandHandler.js';
|
|
6
|
-
import EventHandler from '../handlers/EventHandler.js';
|
|
7
|
-
import InhibitorHandler from '../handlers/InhibitorHandler.js';
|
|
8
|
-
import Extensions from '../models/Extensions.js';
|
|
9
|
-
// TODO - Add
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @
|
|
13
|
-
* @param {
|
|
14
|
-
* @
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
config
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
import { Client, Collection } from 'discord.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { Style } from 'dumfunctions';
|
|
4
|
+
import { ClientUtil } from '../utils/ClientUtil.js';
|
|
5
|
+
import CommandHandler from '../handlers/CommandHandler.js';
|
|
6
|
+
import EventHandler from '../handlers/EventHandler.js';
|
|
7
|
+
import InhibitorHandler from '../handlers/InhibitorHandler.js';
|
|
8
|
+
import Extensions from '../models/Extensions.js';
|
|
9
|
+
// TODO - Add commandNotFound as an event to the client.
|
|
10
|
+
/**
|
|
11
|
+
* @description - The Client.
|
|
12
|
+
* @param {DiscordOptions} discordOptions - The options for discord.js.
|
|
13
|
+
* @param {ClientOptions} clientOptions - The options for the Xernerx Client.
|
|
14
|
+
* @extends {Client}
|
|
15
|
+
*/
|
|
16
|
+
export default class XernerxClient extends Client {
|
|
17
|
+
settings;
|
|
18
|
+
commands;
|
|
19
|
+
cache;
|
|
20
|
+
modules;
|
|
21
|
+
util;
|
|
22
|
+
handlerOptions;
|
|
23
|
+
events;
|
|
24
|
+
extensions;
|
|
25
|
+
inhibitors;
|
|
26
|
+
config;
|
|
27
|
+
constructor(discordOptions, clientOptions, config) {
|
|
28
|
+
super(discordOptions);
|
|
29
|
+
this.settings = z
|
|
30
|
+
.object({
|
|
31
|
+
ownerId: z.string().or(z.array(z.string())).default([]),
|
|
32
|
+
permissions: z
|
|
33
|
+
.object({
|
|
34
|
+
client: z.array(z.string()).default([]),
|
|
35
|
+
user: z.array(z.string()).default([]),
|
|
36
|
+
dm: z.boolean().default(false),
|
|
37
|
+
})
|
|
38
|
+
.optional(),
|
|
39
|
+
ignore: z
|
|
40
|
+
.object({
|
|
41
|
+
owner: z.boolean().default(false),
|
|
42
|
+
users: z.array(z.string()),
|
|
43
|
+
channels: z.array(z.string()),
|
|
44
|
+
guilds: z.array(z.string()),
|
|
45
|
+
})
|
|
46
|
+
.optional(),
|
|
47
|
+
log: z
|
|
48
|
+
.object({
|
|
49
|
+
ready: z.boolean().default(false),
|
|
50
|
+
error: z.boolean().default(false),
|
|
51
|
+
})
|
|
52
|
+
.optional(),
|
|
53
|
+
cooldown: z
|
|
54
|
+
.object({
|
|
55
|
+
command: z.number().default(0),
|
|
56
|
+
cache: z.number().default(0),
|
|
57
|
+
})
|
|
58
|
+
.optional(),
|
|
59
|
+
})
|
|
60
|
+
.parse(clientOptions);
|
|
61
|
+
this.config = config || {};
|
|
62
|
+
this.commands = {
|
|
63
|
+
message: new Collection(),
|
|
64
|
+
slash: new Collection(),
|
|
65
|
+
context: new Collection(),
|
|
66
|
+
};
|
|
67
|
+
this.events = new Collection();
|
|
68
|
+
this.inhibitors = new Collection();
|
|
69
|
+
this.cache = {
|
|
70
|
+
messages: new Collection(),
|
|
71
|
+
cooldowns: new Collection(),
|
|
72
|
+
messageCommands: new Collection(),
|
|
73
|
+
slashCommands: new Collection(),
|
|
74
|
+
contextCommands: new Collection(),
|
|
75
|
+
commands: new Collection(),
|
|
76
|
+
};
|
|
77
|
+
this.modules = {
|
|
78
|
+
commandHandler: new CommandHandler(this),
|
|
79
|
+
eventHandler: new EventHandler(this),
|
|
80
|
+
inhibitorHandler: new InhibitorHandler(this),
|
|
81
|
+
};
|
|
82
|
+
this.extensions = {};
|
|
83
|
+
this.util = new ClientUtil(this);
|
|
84
|
+
this.handlerOptions = {};
|
|
85
|
+
if (this.settings?.log?.ready) {
|
|
86
|
+
this.once('ready', async (client) => {
|
|
87
|
+
const size = (await client.guilds.fetch()).size;
|
|
88
|
+
console.info(Style.log(`Xernerx | ${client.user.tag} signed in watching ${size} server${size > 1 ? 's' : ''}. ${(this.handlerOptions.slash || this.handlerOptions.context)?.guildId
|
|
89
|
+
? `Using ${(await this.guilds.fetch((this.handlerOptions.slash || this.handlerOptions.context)?.guildId || '0')).name} as local guild.`
|
|
90
|
+
: ''}`, { color: Style.TextColor.Purple }));
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
register(token) {
|
|
95
|
+
this.login(token);
|
|
96
|
+
}
|
|
97
|
+
loadAllExtensions(options) {
|
|
98
|
+
const extensions = new Extensions(this);
|
|
99
|
+
return extensions.load(options.extensions, options.logging || false);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -1,27 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { Handler } from './Handler.js';
|
|
2
|
-
import { CommandsDeploy, ContextCommandEvents, MessageCommandEvents, SlashCommandEvents } from '../models/Events.js';
|
|
3
|
-
/**
|
|
4
|
-
* @description - The command handler.
|
|
5
|
-
* @param {XernerxClient} client - The XernerxClient.
|
|
6
|
-
*/
|
|
7
|
-
export default class CommandHandler {
|
|
8
|
-
client;
|
|
9
|
-
handler;
|
|
10
|
-
constructor(client) {
|
|
11
|
-
this.client = client;
|
|
12
|
-
this.handler = new Handler(client);
|
|
13
|
-
new CommandsDeploy(this.client).deploy();
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @description - The message command loader.
|
|
17
|
-
* @param {MessageCommandOptions} options - message command loader options.
|
|
18
|
-
*/
|
|
19
|
-
loadAllMessageCommands(options) {
|
|
20
|
-
this.handler.loadAllMessageCommands(options);
|
|
21
|
-
const events = new MessageCommandEvents(this.client);
|
|
22
|
-
events.messageCreate();
|
|
23
|
-
events.messageUpdate();
|
|
24
|
-
events.messageDelete();
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @description - The slash command loader.
|
|
28
|
-
* @param {SlashCommandOptions} options - slash command loader options.
|
|
29
|
-
*/
|
|
30
|
-
loadAllSlashCommands(options) {
|
|
31
|
-
this.handler.loadAllSlashCommands(options);
|
|
32
|
-
new SlashCommandEvents(this.client).slashCreate();
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @description - The context command loader.
|
|
36
|
-
* @param {ContextCommandOptions} options - context command loader options.
|
|
37
|
-
*/
|
|
38
|
-
loadAllContextCommands(options) {
|
|
39
|
-
this.handler.loadAllContextCommands(options);
|
|
40
|
-
new ContextCommandEvents(this.client).contextCreate();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
import { Handler } from './Handler.js';
|
|
2
|
+
import { CommandsDeploy, ContextCommandEvents, MessageCommandEvents, SlashCommandEvents } from '../models/Events.js';
|
|
3
|
+
/**
|
|
4
|
+
* @description - The command handler.
|
|
5
|
+
* @param {XernerxClient} client - The XernerxClient.
|
|
6
|
+
*/
|
|
7
|
+
export default class CommandHandler {
|
|
8
|
+
client;
|
|
9
|
+
handler;
|
|
10
|
+
constructor(client) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
this.handler = new Handler(client);
|
|
13
|
+
new CommandsDeploy(this.client).deploy();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @description - The message command loader.
|
|
17
|
+
* @param {MessageCommandOptions} options - message command loader options.
|
|
18
|
+
*/
|
|
19
|
+
loadAllMessageCommands(options) {
|
|
20
|
+
this.handler.loadAllMessageCommands(options);
|
|
21
|
+
const events = new MessageCommandEvents(this.client);
|
|
22
|
+
events.messageCreate();
|
|
23
|
+
events.messageUpdate();
|
|
24
|
+
events.messageDelete();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @description - The slash command loader.
|
|
28
|
+
* @param {SlashCommandOptions} options - slash command loader options.
|
|
29
|
+
*/
|
|
30
|
+
loadAllSlashCommands(options) {
|
|
31
|
+
this.handler.loadAllSlashCommands(options);
|
|
32
|
+
new SlashCommandEvents(this.client).slashCreate();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @description - The context command loader.
|
|
36
|
+
* @param {ContextCommandOptions} options - context command loader options.
|
|
37
|
+
*/
|
|
38
|
+
loadAllContextCommands(options) {
|
|
39
|
+
this.handler.loadAllContextCommands(options);
|
|
40
|
+
new ContextCommandEvents(this.client).contextCreate();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,13 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Handler } from './Handler.js';
|
|
2
|
-
export default class EventHandler {
|
|
3
|
-
client;
|
|
4
|
-
handler;
|
|
5
|
-
constructor(client) {
|
|
6
|
-
this.client = client;
|
|
7
|
-
this.handler = new Handler(client);
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @description - The event loader
|
|
11
|
-
* @param {EventLoadOptions} options - message command options
|
|
12
|
-
*/
|
|
13
|
-
loadAllEvents(options) {
|
|
14
|
-
return this.handler.loadAllEvents(options);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
import { Handler } from './Handler.js';
|
|
2
|
+
export default class EventHandler {
|
|
3
|
+
client;
|
|
4
|
+
handler;
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.handler = new Handler(client);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @description - The event loader
|
|
11
|
+
* @param {EventLoadOptions} options - message command options
|
|
12
|
+
*/
|
|
13
|
+
loadAllEvents(options) {
|
|
14
|
+
return this.handler.loadAllEvents(options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,57 +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
|
-
}
|
|
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
|
+
}
|