xernerx 3.4.2 → 3.5.0
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.js +93 -88
- package/dist/build/EventBuilder.js +34 -35
- package/dist/build/InhibitorBuilder.js +27 -28
- package/dist/build/MessageCommandBuilder.js +90 -80
- package/dist/build/SlashCommandBuilder.js +125 -118
- package/dist/client/XernerxClient.js +101 -81
- package/dist/handlers/CommandHandler.js +42 -42
- package/dist/handlers/EventHandler.js +16 -16
- package/dist/handlers/Handler.js +250 -250
- package/dist/handlers/InhibitorHandler.js +21 -21
- package/dist/main.cjs +2012 -0
- package/dist/main.js +42 -42
- package/dist/models/CommandArguments.js +121 -123
- package/dist/models/Events.js +294 -304
- package/dist/models/Extensions.js +23 -23
- package/dist/tools/XernerxError.js +8 -8
- package/dist/tools/package.js +37 -41
- package/dist/types/enums.js +35 -35
- package/dist/types/interfaces.js +1 -1
- package/dist/types/options.js +1 -1
- package/dist/types/types.js +1 -1
- package/dist/utils/ClientUtil.js +222 -218
- package/dist/utils/CommandUtil.js +248 -260
- package/dist/validators/CommandValidations.js +183 -185
- package/dist/validators/InhibitorValidations.js +42 -42
- package/dist/validators/Shapes.js +1 -0
- package/package.json +54 -39
- package/types/build/ContextCommandBuilder.d.ts +68 -0
- package/{dist → types}/build/EventBuilder.d.ts +21 -17
- package/{dist → types}/build/InhibitorBuilder.d.ts +19 -20
- package/types/build/MessageCommandBuilder.d.ts +59 -0
- package/types/build/SlashCommandBuilder.d.ts +64 -0
- package/{dist → types}/client/XernerxClient.d.ts +28 -28
- package/{dist → types}/handlers/CommandHandler.d.ts +27 -26
- package/{dist → types}/handlers/EventHandler.d.ts +13 -12
- package/{dist → types}/handlers/Handler.d.ts +57 -57
- package/{dist → types}/handlers/InhibitorHandler.d.ts +18 -17
- package/{dist → types}/main.d.ts +44 -30
- package/{dist → types}/models/CommandArguments.d.ts +17 -17
- package/{dist → types}/models/Events.d.ts +24 -24
- package/{dist → types}/models/Extensions.d.ts +7 -7
- package/{dist → types}/tools/XernerxError.d.ts +5 -5
- package/{dist → types}/tools/package.d.ts +38 -38
- package/types/types/enums.d.ts +44 -0
- package/{dist → types}/types/interfaces.d.ts +25 -25
- package/{dist → types}/types/options.d.ts +241 -206
- package/{dist → types}/types/types.d.ts +61 -32
- package/{dist → types}/utils/ClientUtil.d.ts +25 -25
- package/{dist → types}/utils/CommandUtil.d.ts +58 -56
- package/{dist → types}/validators/CommandValidations.d.ts +12 -7
- package/{dist → types}/validators/InhibitorValidations.d.ts +11 -11
- package/types/validators/Shapes.d.ts +1 -0
- package/dist/build/ContextCommandBuilder.d.ts +0 -42
- package/dist/build/MessageCommandBuilder.d.ts +0 -42
- package/dist/build/SlashCommandBuilder.d.ts +0 -40
- 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
- package/dist/types/enums.d.ts +0 -35
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { EventOptions } from '../types/options.js';
|
|
3
|
-
/**
|
|
4
|
-
* @description - The event builder for events.
|
|
5
|
-
* @param {String} id - The unique ID of the event.
|
|
6
|
-
* @param {EventOptions} options - The event options.
|
|
7
|
-
*/
|
|
8
|
-
export default class EventBuilder {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
emitter
|
|
12
|
-
type
|
|
13
|
-
once
|
|
14
|
-
client: XernerxClient
|
|
15
|
-
constructor(id: string, options: EventOptions);
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
+
import { EventOptions } from '../types/options.js';
|
|
3
|
+
/**
|
|
4
|
+
* @description - The event builder for events.
|
|
5
|
+
* @param {String} id - The unique ID of the event.
|
|
6
|
+
* @param {EventOptions} options - The event options.
|
|
7
|
+
*/
|
|
8
|
+
export default class EventBuilder {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
emitter: string;
|
|
12
|
+
type: string;
|
|
13
|
+
once: boolean;
|
|
14
|
+
client: typeof XernerxClient;
|
|
15
|
+
constructor(id: string, options: EventOptions);
|
|
16
|
+
/**
|
|
17
|
+
* @description run your custom event here.
|
|
18
|
+
* TODO - update description
|
|
19
|
+
*/
|
|
20
|
+
run(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @
|
|
7
|
-
* @param {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
1
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
+
import { InhibitorOptions, MessageArgumentOptions, SlashArgumentOptions } from '../types/options.js';
|
|
3
|
+
import { XernerxInteraction, XernerxMessage } from '../types/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* @description - The inhibitor builder for inhibitors.
|
|
6
|
+
* @param {String} id - The unique ID of the inhibitor.
|
|
7
|
+
* @param {InhibitorOptions} options - The inhibitor options.
|
|
8
|
+
*/
|
|
9
|
+
export default class InhibitorBuilder {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
type: import('../main.js').InhibitorType;
|
|
13
|
+
client: typeof XernerxClient;
|
|
14
|
+
constructor(id: string, options: InhibitorOptions);
|
|
15
|
+
/**
|
|
16
|
+
* TODO - update description
|
|
17
|
+
*/
|
|
18
|
+
check(interaction: XernerxInteraction | XernerxMessage, args: SlashArgumentOptions | MessageArgumentOptions): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MessageArgumentOptions, MessageCommandOptions } from '../types/options.js';
|
|
2
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
+
import { XernerxMessage } from '../types/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* @description - The command builder for message commands.
|
|
6
|
+
* @param {String} id - The unique ID of the command.
|
|
7
|
+
* @param {MessageCommandOptions} options - The command options.
|
|
8
|
+
*/
|
|
9
|
+
export default class MessageCommandBuilder {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
aliases: string[] | undefined;
|
|
13
|
+
separator: string;
|
|
14
|
+
description: string | undefined;
|
|
15
|
+
info: string | undefined;
|
|
16
|
+
category: string | undefined;
|
|
17
|
+
prefix: string[];
|
|
18
|
+
regex: string | undefined;
|
|
19
|
+
channelType: number[] | undefined;
|
|
20
|
+
ignore:
|
|
21
|
+
| {
|
|
22
|
+
owner?: boolean | undefined;
|
|
23
|
+
users?: string[] | undefined;
|
|
24
|
+
channels?: string[] | undefined;
|
|
25
|
+
guilds?: string[] | undefined;
|
|
26
|
+
}
|
|
27
|
+
| undefined;
|
|
28
|
+
strict:
|
|
29
|
+
| {
|
|
30
|
+
owner?: boolean | undefined;
|
|
31
|
+
users?: string[] | undefined;
|
|
32
|
+
channels?: string[] | undefined;
|
|
33
|
+
guilds?: string[] | undefined;
|
|
34
|
+
}
|
|
35
|
+
| undefined;
|
|
36
|
+
permissions:
|
|
37
|
+
| {
|
|
38
|
+
client?: string[] | undefined;
|
|
39
|
+
user?: string[] | undefined;
|
|
40
|
+
dm?: boolean | undefined;
|
|
41
|
+
}
|
|
42
|
+
| undefined;
|
|
43
|
+
cooldown: number;
|
|
44
|
+
args: MessageArgumentOptions[];
|
|
45
|
+
client: typeof XernerxClient;
|
|
46
|
+
constructor(id: string, options: MessageCommandOptions);
|
|
47
|
+
/**
|
|
48
|
+
* @param {Message} message - The Discord message event data.
|
|
49
|
+
* @param {object} args - The arguments you created.
|
|
50
|
+
* @description make any preconditions here.
|
|
51
|
+
*/
|
|
52
|
+
conditions(message: XernerxMessage, args: MessageArgumentOptions): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* @param {Message} message - The Discord message event data.
|
|
55
|
+
* @param {object} args - The arguments you created.
|
|
56
|
+
* @description Make your custom command here.
|
|
57
|
+
*/
|
|
58
|
+
exec(message: XernerxMessage, args: MessageArgumentOptions): Promise<void>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import Discord, { Interaction } from 'discord.js';
|
|
2
|
+
import { SlashCommandOptions } from '../types/options.js';
|
|
3
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
+
/**
|
|
5
|
+
* @description - The command builder for slash commands.
|
|
6
|
+
* @param {String} id - The unique ID of the command.
|
|
7
|
+
* @param {SlashCommandOptions} options - The command options.
|
|
8
|
+
*/
|
|
9
|
+
export default class SlashCommandBuilder {
|
|
10
|
+
id: string;
|
|
11
|
+
data: Discord.SlashCommandBuilder;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
info: string | undefined;
|
|
15
|
+
category: string | undefined;
|
|
16
|
+
channelType: Discord.ChannelType | undefined;
|
|
17
|
+
cooldown: number | undefined;
|
|
18
|
+
ignore:
|
|
19
|
+
| {
|
|
20
|
+
owner?: boolean | undefined;
|
|
21
|
+
users?: string[] | undefined;
|
|
22
|
+
channels?: string[] | undefined;
|
|
23
|
+
guilds?: string[] | undefined;
|
|
24
|
+
}
|
|
25
|
+
| undefined;
|
|
26
|
+
strict:
|
|
27
|
+
| {
|
|
28
|
+
owner?: boolean | undefined;
|
|
29
|
+
users?: string[] | undefined;
|
|
30
|
+
channels?: string[] | undefined;
|
|
31
|
+
guilds?: string[] | undefined;
|
|
32
|
+
}
|
|
33
|
+
| undefined;
|
|
34
|
+
permissions: {
|
|
35
|
+
client?: string[] | undefined;
|
|
36
|
+
users?: string[] | undefined;
|
|
37
|
+
dm?: boolean | undefined;
|
|
38
|
+
};
|
|
39
|
+
args?: object[];
|
|
40
|
+
subcommands?: object[];
|
|
41
|
+
groups?: object[];
|
|
42
|
+
defer:
|
|
43
|
+
| {
|
|
44
|
+
reply?: boolean | undefined;
|
|
45
|
+
ephemeral?: boolean | undefined;
|
|
46
|
+
fetchReply?: boolean | undefined;
|
|
47
|
+
}
|
|
48
|
+
| undefined;
|
|
49
|
+
client: typeof XernerxClient;
|
|
50
|
+
constructor(id: string, options: SlashCommandOptions);
|
|
51
|
+
/**
|
|
52
|
+
* TODO - update description
|
|
53
|
+
* @param interaction
|
|
54
|
+
*/
|
|
55
|
+
conditions(interaction: Interaction): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* TODO - update description
|
|
58
|
+
* @param interaction
|
|
59
|
+
*/
|
|
60
|
+
exec(interaction: Interaction): Promise<void>;
|
|
61
|
+
private addArgs;
|
|
62
|
+
private addSubcommands;
|
|
63
|
+
private addSubcommandGroups;
|
|
64
|
+
}
|
|
@@ -1,28 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* @
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* @
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* @
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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,12 +1,13 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { EventHandlerOptions } from '../types/options.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* @
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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,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
|
-
|
|
10
|
-
|
|
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
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { InhibitorHandlerOptions } from '../types/options.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
+
import { InhibitorHandlerOptions } from '../types/options.js';
|
|
3
|
+
import { Handler } from './Handler.js';
|
|
4
|
+
/**
|
|
5
|
+
* @description - Inhibitor loader.
|
|
6
|
+
* @param {XernerxClient} client - The XernerxClient.
|
|
7
|
+
*/
|
|
8
|
+
export default class InhibitorHandler {
|
|
9
|
+
client: XernerxClient;
|
|
10
|
+
handler: Handler;
|
|
11
|
+
constructor(client: XernerxClient);
|
|
12
|
+
/**
|
|
13
|
+
* @description - The loader for all inhibitors.
|
|
14
|
+
* @param {InhibitorLoadOptions} options - the inhibitor loader options.
|
|
15
|
+
* @returns undefined
|
|
16
|
+
*/
|
|
17
|
+
loadAllInhibitors(options: InhibitorHandlerOptions): void;
|
|
18
|
+
}
|
package/{dist → types}/main.d.ts
RENAMED
|
@@ -1,30 +1,44 @@
|
|
|
1
|
-
export * from 'discord.js';
|
|
2
|
-
export * from 'dumfunctions';
|
|
3
|
-
import ExtensionBuilder from 'xernerx-extension-builder';
|
|
4
|
-
import XernerxClient from './client/XernerxClient.js';
|
|
5
|
-
import EventBuilder from './build/EventBuilder.js';
|
|
6
|
-
import InhibitorBuilder from './build/InhibitorBuilder.js';
|
|
7
|
-
import MessageCommandBuilder from './build/MessageCommandBuilder.js';
|
|
8
|
-
import ContextCommandBuilder from './build/ContextCommandBuilder.js';
|
|
9
|
-
import SlashCommandBuilder from './build/SlashCommandBuilder.js';
|
|
10
|
-
import { CommandType, EventEmitterType, ContextCommandType, InhibitorType } from './types/enums.js';
|
|
11
|
-
import XernerxError from './tools/XernerxError.js';
|
|
12
|
-
declare const xernerxVersion: string;
|
|
13
|
-
declare const _default: {
|
|
14
|
-
Client: typeof XernerxClient;
|
|
15
|
-
XernerxClient: typeof XernerxClient;
|
|
16
|
-
CommandType: typeof CommandType;
|
|
17
|
-
EventEmitterType: typeof EventEmitterType;
|
|
18
|
-
InhibitorType: typeof InhibitorType;
|
|
19
|
-
ContextCommandType: typeof ContextCommandType;
|
|
20
|
-
EventBuilder: typeof EventBuilder;
|
|
21
|
-
MessageCommandBuilder: typeof MessageCommandBuilder;
|
|
22
|
-
ContextCommandBuilder: typeof ContextCommandBuilder;
|
|
23
|
-
SlashCommandBuilder: typeof SlashCommandBuilder;
|
|
24
|
-
InhibitorBuilder: typeof InhibitorBuilder;
|
|
25
|
-
ExtensionBuilder: typeof ExtensionBuilder;
|
|
26
|
-
XernerxError: typeof XernerxError;
|
|
27
|
-
version: string;
|
|
28
|
-
};
|
|
29
|
-
export default _default;
|
|
30
|
-
export {
|
|
1
|
+
export * from 'discord.js';
|
|
2
|
+
export * from 'dumfunctions';
|
|
3
|
+
import ExtensionBuilder from 'xernerx-extension-builder';
|
|
4
|
+
import XernerxClient from './client/XernerxClient.js';
|
|
5
|
+
import EventBuilder from './build/EventBuilder.js';
|
|
6
|
+
import InhibitorBuilder from './build/InhibitorBuilder.js';
|
|
7
|
+
import MessageCommandBuilder from './build/MessageCommandBuilder.js';
|
|
8
|
+
import ContextCommandBuilder from './build/ContextCommandBuilder.js';
|
|
9
|
+
import SlashCommandBuilder from './build/SlashCommandBuilder.js';
|
|
10
|
+
import { CommandType, EventEmitterType, ContextCommandType, InhibitorType } from './types/enums.js';
|
|
11
|
+
import XernerxError from './tools/XernerxError.js';
|
|
12
|
+
declare const xernerxVersion: string;
|
|
13
|
+
declare const _default: {
|
|
14
|
+
Client: typeof XernerxClient;
|
|
15
|
+
XernerxClient: typeof XernerxClient;
|
|
16
|
+
CommandType: typeof CommandType;
|
|
17
|
+
EventEmitterType: typeof EventEmitterType;
|
|
18
|
+
InhibitorType: typeof InhibitorType;
|
|
19
|
+
ContextCommandType: typeof ContextCommandType;
|
|
20
|
+
EventBuilder: typeof EventBuilder;
|
|
21
|
+
MessageCommandBuilder: typeof MessageCommandBuilder;
|
|
22
|
+
ContextCommandBuilder: typeof ContextCommandBuilder;
|
|
23
|
+
SlashCommandBuilder: typeof SlashCommandBuilder;
|
|
24
|
+
InhibitorBuilder: typeof InhibitorBuilder;
|
|
25
|
+
ExtensionBuilder: typeof ExtensionBuilder;
|
|
26
|
+
XernerxError: typeof XernerxError;
|
|
27
|
+
version: string;
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
30
|
+
export {
|
|
31
|
+
XernerxClient,
|
|
32
|
+
CommandType,
|
|
33
|
+
EventEmitterType,
|
|
34
|
+
InhibitorType,
|
|
35
|
+
ContextCommandType,
|
|
36
|
+
EventBuilder,
|
|
37
|
+
MessageCommandBuilder,
|
|
38
|
+
ContextCommandBuilder,
|
|
39
|
+
SlashCommandBuilder,
|
|
40
|
+
InhibitorBuilder,
|
|
41
|
+
ExtensionBuilder,
|
|
42
|
+
XernerxError,
|
|
43
|
+
xernerxVersion,
|
|
44
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
|
|
2
|
-
import { XernerxInteraction, XernerxMessage } from '../types/types.js';
|
|
3
|
-
export declare class InteractionArguments {
|
|
4
|
-
|
|
5
|
-
constructor(interaction: XernerxInteraction);
|
|
6
|
-
group(): string | undefined;
|
|
7
|
-
subcommand(): string | undefined;
|
|
8
|
-
arguments(): Record<string, object>;
|
|
9
|
-
}
|
|
10
|
-
interface Flag {
|
|
11
|
-
flags: Record<string, string | boolean>;
|
|
12
|
-
}
|
|
13
|
-
interface Argument {
|
|
14
|
-
[index: string]: string | number | null;
|
|
15
|
-
}
|
|
16
|
-
export declare function messageArguments(message: XernerxMessage, command: MessageCommandBuilder): Promise<import(
|
|
17
|
-
export {};
|
|
1
|
+
import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
|
|
2
|
+
import { XernerxInteraction, XernerxMessage } from '../types/types.js';
|
|
3
|
+
export declare class InteractionArguments {
|
|
4
|
+
interaction: XernerxInteraction;
|
|
5
|
+
constructor(interaction: XernerxInteraction);
|
|
6
|
+
group(): string | undefined;
|
|
7
|
+
subcommand(): string | undefined;
|
|
8
|
+
arguments(): Record<string, object>;
|
|
9
|
+
}
|
|
10
|
+
interface Flag {
|
|
11
|
+
flags: Record<string, string | boolean>;
|
|
12
|
+
}
|
|
13
|
+
interface Argument {
|
|
14
|
+
[index: string]: string | number | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function messageArguments(message: XernerxMessage, command: MessageCommandBuilder): Promise<import('discord.js').Message<boolean> | Flag | Argument | undefined>;
|
|
17
|
+
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
export declare class MessageCommandEvents {
|
|
3
|
-
|
|
4
|
-
constructor(client: XernerxClient);
|
|
5
|
-
messageCreate(): void;
|
|
6
|
-
messageUpdate(): void;
|
|
7
|
-
messageDelete(): void;
|
|
8
|
-
}
|
|
9
|
-
export declare class SlashCommandEvents {
|
|
10
|
-
|
|
11
|
-
constructor(client: XernerxClient);
|
|
12
|
-
slashCreate(): void;
|
|
13
|
-
}
|
|
14
|
-
export declare class ContextCommandEvents {
|
|
15
|
-
|
|
16
|
-
constructor(client: XernerxClient);
|
|
17
|
-
contextCreate(): void;
|
|
18
|
-
}
|
|
19
|
-
export declare class CommandsDeploy {
|
|
20
|
-
private client;
|
|
21
|
-
constructor(client: XernerxClient);
|
|
22
|
-
deploy(): void;
|
|
23
|
-
private put;
|
|
24
|
-
}
|
|
1
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
+
export declare class MessageCommandEvents {
|
|
3
|
+
client: XernerxClient;
|
|
4
|
+
constructor(client: XernerxClient);
|
|
5
|
+
messageCreate(): void;
|
|
6
|
+
messageUpdate(): void;
|
|
7
|
+
messageDelete(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class SlashCommandEvents {
|
|
10
|
+
client: XernerxClient;
|
|
11
|
+
constructor(client: XernerxClient);
|
|
12
|
+
slashCreate(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class ContextCommandEvents {
|
|
15
|
+
client: XernerxClient;
|
|
16
|
+
constructor(client: XernerxClient);
|
|
17
|
+
contextCreate(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class CommandsDeploy {
|
|
20
|
+
private client;
|
|
21
|
+
constructor(client: XernerxClient);
|
|
22
|
+
deploy(): void;
|
|
23
|
+
private put;
|
|
24
|
+
}
|