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
package/README.md
CHANGED
|
@@ -4,18 +4,18 @@ Xernerx is a class based discord.js framework. \[BETA\]
|
|
|
4
4
|
|
|
5
5
|
## Includes
|
|
6
6
|
|
|
7
|
-
> -
|
|
8
|
-
> -
|
|
9
|
-
> -
|
|
10
|
-
> -
|
|
11
|
-
> -
|
|
12
|
-
> -
|
|
13
|
-
> -
|
|
14
|
-
> -
|
|
7
|
+
> - Slash command handler
|
|
8
|
+
> - Message command handler
|
|
9
|
+
> - Context command handler
|
|
10
|
+
> - Event handler (with custom Events)
|
|
11
|
+
> - Inhibitor handler
|
|
12
|
+
> - Custom utilities
|
|
13
|
+
> - Message command handles
|
|
14
|
+
> - Extension support
|
|
15
15
|
|
|
16
16
|
You can checkout the docs [here](https://xernerx.github.io/xernerx/home.html)
|
|
17
17
|
|
|
18
18
|
## Notes
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- Only compatible with ESM
|
|
21
|
+
- TypeScript and JavaScript support
|
|
@@ -1,42 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContextCommandOptions } from '../types/options.js';
|
|
3
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
-
/**
|
|
5
|
-
* @description The command builder for context commands.
|
|
6
|
-
* @param {String} id - The unique ID of the command.
|
|
7
|
-
* @param {ContextCommandOptions} options - The command options.
|
|
8
|
-
*/
|
|
9
|
-
export default class ContextCommandBuilder {
|
|
10
|
-
id: string;
|
|
11
|
-
data: ContextMenuCommandBuilder;
|
|
12
|
-
name: string;
|
|
13
|
-
type:
|
|
14
|
-
description
|
|
15
|
-
info
|
|
16
|
-
category
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
import { ContextMenuCommandBuilder, Interaction } from 'discord.js';
|
|
2
|
+
import { ContextCommandOptions } from '../types/options.js';
|
|
3
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
+
/**
|
|
5
|
+
* @description The command builder for context commands.
|
|
6
|
+
* @param {String} id - The unique ID of the command.
|
|
7
|
+
* @param {ContextCommandOptions} options - The command options.
|
|
8
|
+
*/
|
|
9
|
+
export default class ContextCommandBuilder {
|
|
10
|
+
id: string;
|
|
11
|
+
data: ContextMenuCommandBuilder;
|
|
12
|
+
name: string;
|
|
13
|
+
type: import("@discordjs/builders").ContextMenuCommandType;
|
|
14
|
+
description: string | undefined;
|
|
15
|
+
info: string | undefined;
|
|
16
|
+
category: string | undefined;
|
|
17
|
+
channelType: number | number[] | undefined;
|
|
18
|
+
cooldown: number | undefined;
|
|
19
|
+
ignore: {
|
|
20
|
+
owner?: boolean | undefined;
|
|
21
|
+
users?: string[] | undefined;
|
|
22
|
+
channels?: string[] | undefined;
|
|
23
|
+
guilds?: string[] | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
strict: {
|
|
26
|
+
owner?: boolean | undefined;
|
|
27
|
+
users?: string[] | undefined;
|
|
28
|
+
channels?: string[] | undefined;
|
|
29
|
+
guilds?: string[] | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
permissions: {
|
|
32
|
+
client?: string[] | undefined;
|
|
33
|
+
users?: string[] | undefined;
|
|
34
|
+
dm?: boolean | undefined;
|
|
35
|
+
} | undefined;
|
|
36
|
+
defer: {
|
|
37
|
+
/**
|
|
38
|
+
* @param {Interaction} interaction - The Discord interaction event data.
|
|
39
|
+
* @description Make your custom command here.
|
|
40
|
+
* TODO - update description
|
|
41
|
+
*/
|
|
42
|
+
reply?: boolean | undefined;
|
|
43
|
+
ephemeral?: boolean | undefined;
|
|
44
|
+
fetch?: boolean | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
client: typeof XernerxClient;
|
|
47
|
+
constructor(id: string, options: ContextCommandOptions);
|
|
48
|
+
/**
|
|
49
|
+
* @param {Interaction} interaction - The Discord interaction event data.
|
|
50
|
+
* @description make any preconditions here.
|
|
51
|
+
* TODO - update description
|
|
52
|
+
*/
|
|
53
|
+
conditions(interaction: Interaction, args: any): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* @param {Interaction} interaction - The Discord interaction event data.
|
|
56
|
+
* @description Make your custom command here.
|
|
57
|
+
* TODO - update description
|
|
58
|
+
*/
|
|
59
|
+
exec(interaction: Interaction, args: any): Promise<void>;
|
|
60
|
+
}
|
|
@@ -1,86 +1,93 @@
|
|
|
1
|
-
import { ContextMenuCommandBuilder } from 'discord.js';
|
|
2
|
-
import {
|
|
3
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
-
/**
|
|
5
|
-
* @description The command builder for context commands.
|
|
6
|
-
* @param {String} id - The unique ID of the command.
|
|
7
|
-
* @param {ContextCommandOptions} options - The command options.
|
|
8
|
-
*/
|
|
9
|
-
export default class ContextCommandBuilder {
|
|
10
|
-
id;
|
|
11
|
-
data;
|
|
12
|
-
name;
|
|
13
|
-
type;
|
|
14
|
-
description;
|
|
15
|
-
info;
|
|
16
|
-
category;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @param {Interaction} interaction - The Discord interaction event data.
|
|
83
|
-
* @description
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
1
|
+
import { ContextMenuCommandBuilder } from 'discord.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
+
/**
|
|
5
|
+
* @description The command builder for context commands.
|
|
6
|
+
* @param {String} id - The unique ID of the command.
|
|
7
|
+
* @param {ContextCommandOptions} options - The command options.
|
|
8
|
+
*/
|
|
9
|
+
export default class ContextCommandBuilder {
|
|
10
|
+
id;
|
|
11
|
+
data;
|
|
12
|
+
name;
|
|
13
|
+
type;
|
|
14
|
+
description;
|
|
15
|
+
info;
|
|
16
|
+
category;
|
|
17
|
+
channelType;
|
|
18
|
+
cooldown;
|
|
19
|
+
ignore;
|
|
20
|
+
strict;
|
|
21
|
+
permissions;
|
|
22
|
+
defer;
|
|
23
|
+
client;
|
|
24
|
+
constructor(id, options) {
|
|
25
|
+
this.id = id;
|
|
26
|
+
this.data = new ContextMenuCommandBuilder();
|
|
27
|
+
if (options.name)
|
|
28
|
+
this.data.setName(options.name);
|
|
29
|
+
if (options.type)
|
|
30
|
+
this.data.setType(options.type);
|
|
31
|
+
if (options.permissions?.users)
|
|
32
|
+
this.data.setDefaultMemberPermissions(options.permissions?.users);
|
|
33
|
+
if (options.permissions?.dm === false)
|
|
34
|
+
this.data.setDMPermission(options.permissions?.dm);
|
|
35
|
+
if (options.nameLocalizations)
|
|
36
|
+
this.data.setNameLocalizations(options.nameLocalizations);
|
|
37
|
+
z.object({
|
|
38
|
+
description: z.string(),
|
|
39
|
+
info: z.string(),
|
|
40
|
+
category: z.string(),
|
|
41
|
+
channelType: z.array(z.number()).or(z.number()),
|
|
42
|
+
cooldown: z.number(),
|
|
43
|
+
ignore: z.object({
|
|
44
|
+
owner: z.boolean(),
|
|
45
|
+
users: z.array(z.string()),
|
|
46
|
+
channels: z.array(z.string()),
|
|
47
|
+
guilds: z.array(z.string()),
|
|
48
|
+
}),
|
|
49
|
+
strict: z.object({
|
|
50
|
+
owner: z.boolean(),
|
|
51
|
+
users: z.array(z.string()),
|
|
52
|
+
channels: z.array(z.string()),
|
|
53
|
+
guilds: z.array(z.string()),
|
|
54
|
+
}),
|
|
55
|
+
permissions: z.object({
|
|
56
|
+
client: z.array(z.string()),
|
|
57
|
+
users: z.array(z.string()),
|
|
58
|
+
dm: z.boolean(),
|
|
59
|
+
}),
|
|
60
|
+
defer: z.object({
|
|
61
|
+
reply: z.boolean(),
|
|
62
|
+
ephemeral: z.boolean(),
|
|
63
|
+
fetch: z.boolean(),
|
|
64
|
+
}),
|
|
65
|
+
})
|
|
66
|
+
.deepPartial()
|
|
67
|
+
.parse(options);
|
|
68
|
+
this.name = options.name;
|
|
69
|
+
this.type = options.type;
|
|
70
|
+
this.description = options.description;
|
|
71
|
+
this.info = options.info;
|
|
72
|
+
this.category = options.category;
|
|
73
|
+
this.channelType = options.channelType;
|
|
74
|
+
this.cooldown = options.cooldown;
|
|
75
|
+
this.ignore = options.ignore;
|
|
76
|
+
this.strict = options.strict;
|
|
77
|
+
this.permissions = options.permissions;
|
|
78
|
+
this.defer = options.defer;
|
|
79
|
+
this.client = XernerxClient;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @param {Interaction} interaction - The Discord interaction event data.
|
|
83
|
+
* @description make any preconditions here.
|
|
84
|
+
* TODO - update description
|
|
85
|
+
*/
|
|
86
|
+
async conditions(interaction, args) { }
|
|
87
|
+
/**
|
|
88
|
+
* @param {Interaction} interaction - The Discord interaction event data.
|
|
89
|
+
* @description Make your custom command here.
|
|
90
|
+
* TODO - update description
|
|
91
|
+
*/
|
|
92
|
+
async exec(interaction, args) { }
|
|
93
|
+
}
|
|
@@ -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,35 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.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;
|
|
10
|
-
name;
|
|
11
|
-
emitter;
|
|
12
|
-
type;
|
|
13
|
-
once;
|
|
14
|
-
client;
|
|
15
|
-
constructor(id, options) {
|
|
16
|
-
this.id = id;
|
|
17
|
-
|
|
18
|
-
name:
|
|
19
|
-
emitter:
|
|
20
|
-
type:
|
|
21
|
-
once:
|
|
22
|
-
}).parse(options);
|
|
23
|
-
this.name = options.name;
|
|
24
|
-
this.emitter = options.emitter || 'client';
|
|
25
|
-
this.type = options.type || 'discord';
|
|
26
|
-
this.once = options.once || false;
|
|
27
|
-
this.client = XernerxClient;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import XernerxClient from '../client/XernerxClient.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;
|
|
10
|
+
name;
|
|
11
|
+
emitter;
|
|
12
|
+
type;
|
|
13
|
+
once;
|
|
14
|
+
client;
|
|
15
|
+
constructor(id, options) {
|
|
16
|
+
this.id = id;
|
|
17
|
+
z.object({
|
|
18
|
+
name: z.string(),
|
|
19
|
+
emitter: z.string().optional(),
|
|
20
|
+
type: z.string().optional(),
|
|
21
|
+
once: z.boolean().optional(),
|
|
22
|
+
}).parse(options);
|
|
23
|
+
this.name = options.name;
|
|
24
|
+
this.emitter = options.emitter || 'client';
|
|
25
|
+
this.type = options.type || 'discord';
|
|
26
|
+
this.once = options.once || false;
|
|
27
|
+
this.client = XernerxClient;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @description run your custom event here.
|
|
31
|
+
* TODO - update description
|
|
32
|
+
*/
|
|
33
|
+
async run() { }
|
|
34
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
/**
|
|
4
|
-
* @description - The inhibitor builder for inhibitors.
|
|
5
|
-
* @param {String} id - The unique ID of the inhibitor.
|
|
6
|
-
* @param {InhibitorOptions} options - The inhibitor options.
|
|
7
|
-
*/
|
|
8
|
-
export default class InhibitorBuilder {
|
|
9
|
-
id;
|
|
10
|
-
name;
|
|
11
|
-
type;
|
|
12
|
-
client;
|
|
13
|
-
constructor(id, options) {
|
|
14
|
-
this.id = id;
|
|
15
|
-
|
|
16
|
-
name:
|
|
17
|
-
type:
|
|
18
|
-
}).parse(options);
|
|
19
|
-
this.name = options.name;
|
|
20
|
-
this.type = options.type;
|
|
21
|
-
this.client = XernerxClient;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
async check(interaction, args) { }
|
|
27
|
-
}
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
+
/**
|
|
4
|
+
* @description - The inhibitor builder for inhibitors.
|
|
5
|
+
* @param {String} id - The unique ID of the inhibitor.
|
|
6
|
+
* @param {InhibitorOptions} options - The inhibitor options.
|
|
7
|
+
*/
|
|
8
|
+
export default class InhibitorBuilder {
|
|
9
|
+
id;
|
|
10
|
+
name;
|
|
11
|
+
type;
|
|
12
|
+
client;
|
|
13
|
+
constructor(id, options) {
|
|
14
|
+
this.id = id;
|
|
15
|
+
z.object({
|
|
16
|
+
name: z.string(),
|
|
17
|
+
type: z.string(),
|
|
18
|
+
}).parse(options);
|
|
19
|
+
this.name = options.name;
|
|
20
|
+
this.type = options.type;
|
|
21
|
+
this.client = XernerxClient;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* TODO - update description
|
|
25
|
+
*/
|
|
26
|
+
async check(interaction, args) { }
|
|
27
|
+
}
|
|
@@ -1,42 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
channelType
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
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
|
+
owner?: boolean | undefined;
|
|
22
|
+
users?: string[] | undefined;
|
|
23
|
+
channels?: string[] | undefined;
|
|
24
|
+
guilds?: string[] | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
strict: {
|
|
27
|
+
owner?: boolean | undefined;
|
|
28
|
+
users?: string[] | undefined;
|
|
29
|
+
channels?: string[] | undefined;
|
|
30
|
+
guilds?: string[] | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
permissions: {
|
|
33
|
+
client?: string[] | undefined;
|
|
34
|
+
user?: string[] | undefined;
|
|
35
|
+
dm?: boolean | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
cooldown: number;
|
|
38
|
+
args: MessageArgumentOptions[];
|
|
39
|
+
client: typeof XernerxClient;
|
|
40
|
+
constructor(id: string, options: MessageCommandOptions);
|
|
41
|
+
/**
|
|
42
|
+
* @param {Message} message - The Discord message event data.
|
|
43
|
+
* @param {object} args - The arguments you created.
|
|
44
|
+
* @description make any preconditions here.
|
|
45
|
+
*/
|
|
46
|
+
conditions(message: XernerxMessage, args: MessageArgumentOptions): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* @param {Message} message - The Discord message event data.
|
|
49
|
+
* @param {object} args - The arguments you created.
|
|
50
|
+
* @description Make your custom command here.
|
|
51
|
+
*/
|
|
52
|
+
exec(message: XernerxMessage, args: MessageArgumentOptions): Promise<void>;
|
|
53
|
+
}
|