xernerx 4.5.23 → 4.5.27
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 +3 -0
- package/dist/build/XernerxContextCommand.d.ts +42 -50
- package/dist/build/XernerxContextCommand.js +71 -71
- package/dist/build/XernerxEvent.d.ts +15 -15
- package/dist/build/XernerxEvent.js +22 -22
- package/dist/build/XernerxInhibitor.d.ts +16 -26
- package/dist/build/XernerxInhibitor.d.ts.map +1 -1
- package/dist/build/XernerxInhibitor.js +20 -20
- package/dist/build/XernerxInhibitor.js.map +1 -1
- package/dist/build/XernerxMessageCommand.d.ts +47 -53
- package/dist/build/XernerxMessageCommand.js +70 -70
- package/dist/build/XernerxSlashCommand.d.ts +57 -71
- package/dist/build/XernerxSlashCommand.js +128 -128
- package/dist/client/XernerxClient.d.ts +40 -48
- package/dist/client/XernerxClient.js +77 -77
- package/dist/client/XernerxShardClient.d.ts +12 -12
- package/dist/client/XernerxShardClient.js +39 -47
- package/dist/functions/deploy.d.ts +1 -1
- package/dist/functions/deploy.js +36 -31
- package/dist/functions/load.d.ts +1 -1
- package/dist/functions/load.js +29 -28
- package/dist/functions/reload.d.ts +1 -1
- package/dist/functions/reload.js +38 -35
- package/dist/functions/sendWebhook.d.ts +1 -1
- package/dist/functions/sendWebhook.js +12 -11
- package/dist/functions/setPresence.d.ts +2 -2
- package/dist/functions/setPresence.js +17 -18
- package/dist/functions/xernerxUser.d.ts +1 -1
- package/dist/functions/xernerxUser.js +6 -6
- package/dist/handlers/CommandHandler.d.ts +9 -9
- package/dist/handlers/CommandHandler.d.ts.map +1 -1
- package/dist/handlers/CommandHandler.js +277 -249
- package/dist/handlers/CommandHandler.js.map +1 -1
- package/dist/handlers/EventHandler.d.ts +3 -3
- package/dist/handlers/EventHandler.js +19 -19
- package/dist/handlers/ExtensionHandler.d.ts +3 -3
- package/dist/handlers/ExtensionHandler.js +20 -18
- package/dist/handlers/Handler.d.ts +8 -8
- package/dist/handlers/Handler.js +42 -32
- package/dist/handlers/InhibitorHandler.d.ts +3 -3
- package/dist/handlers/InhibitorHandler.js +19 -19
- package/dist/handlers/WebhookHandler.d.ts +6 -4
- package/dist/handlers/WebhookHandler.js +44 -47
- package/dist/main.d.ts +22 -29
- package/dist/main.js +22 -29
- package/dist/models/Arguments.d.ts +2 -5
- package/dist/models/Arguments.js +150 -135
- package/dist/tools/XernerxError.d.ts +5 -5
- package/dist/tools/XernerxError.js +9 -9
- package/dist/tools/XernerxLog.d.ts +13 -13
- package/dist/tools/XernerxLog.js +69 -74
- package/dist/tools/XernerxText.d.ts +23 -23
- package/dist/tools/XernerxText.js +85 -76
- package/dist/types/extenders.d.ts +36 -44
- package/dist/types/extenders.js +1 -1
- package/dist/types/interfaces.d.ts +182 -185
- package/dist/types/interfaces.js +1 -1
- package/dist/types/types.d.ts +7 -179
- package/dist/types/types.js +1 -1
- package/dist/utils/ClientUtil.d.ts +9 -11
- package/dist/utils/ClientUtil.js +73 -57
- package/dist/utils/InteractionUtil.d.ts +7 -7
- package/dist/utils/InteractionUtil.js +98 -96
- package/dist/utils/MessageUtil.d.ts +11 -11
- package/dist/utils/MessageUtil.js +135 -130
- package/dist/utils/Util.d.ts +5 -5
- package/dist/utils/Util.js +8 -8
- package/dist/validators/commandValidation.d.ts +2 -5
- package/dist/validators/commandValidation.js +53 -43
- package/dist/validators/inhibitorValidations.d.ts +4 -20
- package/dist/validators/inhibitorValidations.d.ts.map +1 -1
- package/dist/validators/inhibitorValidations.js +32 -32
- package/dist/validators/inhibitorValidations.js.map +1 -1
- package/package.json +16 -13
package/README.md
CHANGED
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|

|
|
10
10
|

|
|
11
11
|

|
|
12
|
+
[](https://wakatime.com/badge/user/0eeef1b5-98a7-4ec0-ab4c-db00536d5ed1/project/23ab34b7-623b-45e8-b8db-e9f1910589f7)
|
|
13
|
+

|
|
14
|
+

|
|
12
15
|
|
|
13
16
|
</center>
|
|
14
17
|
# About
|
|
@@ -3,54 +3,46 @@ import { ContextMenuCommandBuilder } from 'discord.js';
|
|
|
3
3
|
import { XernerxMessageContextInteraction, XernerxUserContextInteraction, XernerxClientType } from '../types/extenders.js';
|
|
4
4
|
import { ContextCommandArguments, ContextCommandOptions } from '../types/interfaces.js';
|
|
5
5
|
export default class XernerxContextCommand {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
readonly client: XernerxClientType;
|
|
48
|
-
constructor(id: string, options: ContextCommandOptions);
|
|
49
|
-
/**
|
|
50
|
-
* @description the execution of the command
|
|
51
|
-
* @param interaction - Interaction event emitted on command
|
|
52
|
-
* @param args - The arguments parsed with the command, if any
|
|
53
|
-
*/
|
|
54
|
-
exec(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<any>;
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly data: ContextMenuCommandBuilder;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly type: 'user' | 'message';
|
|
10
|
+
readonly description: string | null | undefined;
|
|
11
|
+
readonly usage: string | null | undefined;
|
|
12
|
+
readonly info: string | null | undefined;
|
|
13
|
+
readonly category: string | null | undefined;
|
|
14
|
+
readonly cooldown: number | null | undefined;
|
|
15
|
+
readonly ignore: {
|
|
16
|
+
owner?: boolean | undefined;
|
|
17
|
+
users?: string[] | undefined;
|
|
18
|
+
channels?: string[] | undefined;
|
|
19
|
+
guilds?: string[] | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
readonly strict: {
|
|
22
|
+
owner?: boolean | undefined;
|
|
23
|
+
users?: string[] | undefined;
|
|
24
|
+
channels?: string[] | undefined;
|
|
25
|
+
guilds?: string[] | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
readonly permissions: {
|
|
28
|
+
user?: string[] | import("../main.js").PermissionNames[] | undefined;
|
|
29
|
+
client?: string[] | import("../main.js").PermissionNames[] | undefined;
|
|
30
|
+
dm?: boolean | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
readonly defer: {
|
|
33
|
+
reply?: boolean | undefined;
|
|
34
|
+
ephemeral?: boolean | undefined;
|
|
35
|
+
fetchReply?: boolean | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
readonly filetype: 'ContextCommand';
|
|
38
|
+
readonly filepath: string;
|
|
39
|
+
readonly client: XernerxClientType;
|
|
40
|
+
constructor(id: string, options: ContextCommandOptions);
|
|
41
|
+
/**
|
|
42
|
+
* @description the execution of the command
|
|
43
|
+
* @param interaction - Interaction event emitted on command
|
|
44
|
+
* @param args - The arguments parsed with the command, if any
|
|
45
|
+
*/
|
|
46
|
+
exec(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<any>;
|
|
55
47
|
}
|
|
56
|
-
//# sourceMappingURL=XernerxContextCommand.d.ts.map
|
|
48
|
+
//# sourceMappingURL=XernerxContextCommand.d.ts.map
|
|
@@ -3,75 +3,75 @@ import { ContextMenuCommandBuilder } from 'discord.js';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { XernerxLog } from '../main.js';
|
|
5
5
|
export default class XernerxContextCommand {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
6
|
+
constructor(id, options) {
|
|
7
|
+
this.id = id;
|
|
8
|
+
this.data = new ContextMenuCommandBuilder();
|
|
9
|
+
this.data.setName(options.name);
|
|
10
|
+
this.data.setNameLocalizations(options.nameLocalizations || null);
|
|
11
|
+
this.data.setType(options.type === 'user' ? 2 : 3);
|
|
12
|
+
this.data.setDMPermission(options.permissions?.dm || null);
|
|
13
|
+
options = z
|
|
14
|
+
.object({
|
|
15
|
+
name: z.string(),
|
|
16
|
+
type: z.enum(['user', 'message']),
|
|
17
|
+
description: z.string().or(z.null()).default(null),
|
|
18
|
+
usage: z.string().or(z.null()).default(null),
|
|
19
|
+
info: z.string().or(z.null()).default(null),
|
|
20
|
+
category: z.string().or(z.null()).default(null),
|
|
21
|
+
cooldown: z.number().or(z.null()).default(null),
|
|
22
|
+
ignore: z
|
|
23
|
+
.object({
|
|
24
|
+
owner: z.boolean().default(false),
|
|
25
|
+
users: z.array(z.string()).default([]),
|
|
26
|
+
channels: z.array(z.string()).default([]),
|
|
27
|
+
guilds: z.array(z.string()).default([]),
|
|
28
|
+
})
|
|
29
|
+
.default({}),
|
|
30
|
+
strict: z
|
|
31
|
+
.object({
|
|
32
|
+
owner: z.boolean().default(false),
|
|
33
|
+
users: z.array(z.string()).default([]),
|
|
34
|
+
channels: z.array(z.string()).default([]),
|
|
35
|
+
guilds: z.array(z.string()).default([]),
|
|
36
|
+
})
|
|
37
|
+
.default({}),
|
|
38
|
+
permissions: z
|
|
39
|
+
.object({
|
|
40
|
+
user: z.array(z.string()).default([]),
|
|
41
|
+
client: z.array(z.string()).default([]),
|
|
42
|
+
dm: z.boolean().default(true),
|
|
43
|
+
})
|
|
44
|
+
.default({}),
|
|
45
|
+
defer: z
|
|
46
|
+
.object({
|
|
47
|
+
reply: z.boolean().default(false),
|
|
48
|
+
ephemeral: z.boolean().default(false),
|
|
49
|
+
fetch: z.boolean().default(false),
|
|
50
|
+
})
|
|
51
|
+
.default({}),
|
|
52
|
+
})
|
|
53
|
+
.parse(options);
|
|
54
|
+
this.name = options.name;
|
|
55
|
+
this.type = options.type;
|
|
56
|
+
this.description = options.description;
|
|
57
|
+
this.usage = options.usage;
|
|
58
|
+
this.info = options.info;
|
|
59
|
+
this.category = options.category;
|
|
60
|
+
this.cooldown = options.cooldown;
|
|
61
|
+
this.ignore = options.ignore;
|
|
62
|
+
this.strict = options.strict;
|
|
63
|
+
this.permissions = options.permissions;
|
|
64
|
+
this.defer = options.defer;
|
|
65
|
+
this.client = this.client;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @description the execution of the command
|
|
69
|
+
* @param interaction - Interaction event emitted on command
|
|
70
|
+
* @param args - The arguments parsed with the command, if any
|
|
71
|
+
*/
|
|
72
|
+
async exec(interaction, args) {
|
|
73
|
+
new XernerxLog(this.client).error(`${this.id} doesn't have an execution rule.`);
|
|
74
|
+
return await this.client.emit('commandError', interaction, `${this.id} doesn't have an execution rule.`, this, this.filetype);
|
|
75
|
+
}
|
|
76
76
|
}
|
|
77
|
-
//# sourceMappingURL=XernerxContextCommand.js.map
|
|
77
|
+
//# sourceMappingURL=XernerxContextCommand.js.map
|
|
@@ -8,19 +8,19 @@ import { XernerxClientType } from '../main.js';
|
|
|
8
8
|
* @param {EventOptions} options - The event options.
|
|
9
9
|
*/
|
|
10
10
|
export default class XernerxEvent {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly name: XernerxEventType | string;
|
|
13
|
+
readonly emitter?: 'client' | 'process' | string;
|
|
14
|
+
readonly type?: 'discord' | string;
|
|
15
|
+
readonly once?: boolean;
|
|
16
|
+
readonly filetype: 'Event';
|
|
17
|
+
readonly filepath: string;
|
|
18
|
+
readonly client: XernerxClientType;
|
|
19
|
+
constructor(id: string, options: XernerxEventOptions);
|
|
20
|
+
/**
|
|
21
|
+
* @description run your custom event here.
|
|
22
|
+
* @param any - there can be all kinds of parameters on events.
|
|
23
|
+
*/
|
|
24
|
+
run(...args: any): Promise<any>;
|
|
25
25
|
}
|
|
26
|
-
//# sourceMappingURL=XernerxEvent.d.ts.map
|
|
26
|
+
//# sourceMappingURL=XernerxEvent.d.ts.map
|
|
@@ -7,26 +7,26 @@ import { XernerxLog } from '../main.js';
|
|
|
7
7
|
* @param {EventOptions} options - The event options.
|
|
8
8
|
*/
|
|
9
9
|
export default class XernerxEvent {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
constructor(id, options) {
|
|
11
|
+
this.id = id;
|
|
12
|
+
z.object({
|
|
13
|
+
name: z.string(),
|
|
14
|
+
emitter: z.string().optional(),
|
|
15
|
+
type: z.string().optional(),
|
|
16
|
+
once: z.boolean().optional(),
|
|
17
|
+
}).parse(options);
|
|
18
|
+
this.name = options.name;
|
|
19
|
+
this.emitter = options.emitter || 'client';
|
|
20
|
+
this.type = options.type || 'discord';
|
|
21
|
+
this.once = options.once || false;
|
|
22
|
+
this.client = this.client;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @description run your custom event here.
|
|
26
|
+
* @param any - there can be all kinds of parameters on events.
|
|
27
|
+
*/
|
|
28
|
+
async run(...args) {
|
|
29
|
+
return new XernerxLog(this.client).error(`${this.id} doesn't have a run rule.`);
|
|
30
|
+
}
|
|
31
31
|
}
|
|
32
|
-
//# sourceMappingURL=XernerxEvent.js.map
|
|
32
|
+
//# sourceMappingURL=XernerxEvent.js.map
|
|
@@ -1,36 +1,26 @@
|
|
|
1
1
|
/** @format */
|
|
2
|
-
import { XernerxInhibitorOptions, MessageCommandArguments, SlashCommandArguments } from '../types/interfaces.js';
|
|
2
|
+
import { XernerxInhibitorOptions, MessageCommandArguments, SlashCommandArguments, ContextCommandArguments } from '../types/interfaces.js';
|
|
3
3
|
import { InhibitorType, XernerxInteraction } from '../types/types.js';
|
|
4
4
|
import { XernerxClientType, XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
5
|
+
import { XernerxContextCommand, XernerxMessageCommand, XernerxSlashCommand } from '../main.js';
|
|
5
6
|
/**
|
|
6
7
|
* @description - The inhibitor builder for inhibitors.
|
|
7
8
|
* @param {String} id - The unique ID of the inhibitor.
|
|
8
9
|
* @param {InhibitorOptions} options - The inhibitor options.
|
|
9
10
|
*/
|
|
10
11
|
export default class XernerxInhibitor {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
interaction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
|
|
25
|
-
args:
|
|
26
|
-
| (T extends XernerxMessage
|
|
27
|
-
? MessageCommandArguments
|
|
28
|
-
: T extends XernerxSlashInteraction
|
|
29
|
-
? SlashCommandArguments
|
|
30
|
-
: T extends XernerxUserContextInteraction
|
|
31
|
-
? XernerxUserContextInteraction
|
|
32
|
-
: XernerxMessageContextInteraction)
|
|
33
|
-
| null
|
|
34
|
-
): Promise<any>;
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly type: InhibitorType;
|
|
15
|
+
readonly filetype: 'Inhibitor';
|
|
16
|
+
readonly filepath: string;
|
|
17
|
+
readonly client: XernerxClientType;
|
|
18
|
+
constructor(id: string, options: XernerxInhibitorOptions);
|
|
19
|
+
/**
|
|
20
|
+
* @description The check rule
|
|
21
|
+
* @param interaction - The interaction with the inhibitor, can be message and interaction
|
|
22
|
+
* @param args - The arguments parsed with this command
|
|
23
|
+
*/
|
|
24
|
+
check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(interaction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, args: (T extends XernerxMessage ? MessageCommandArguments : T extends XernerxSlashInteraction ? SlashCommandArguments : T extends XernerxUserContextInteraction ? ContextCommandArguments<'user' | 'message'> : never) | null, command: XernerxSlashCommand | XernerxMessageCommand | XernerxContextCommand): Promise<any>;
|
|
35
25
|
}
|
|
36
|
-
//# sourceMappingURL=XernerxInhibitor.d.ts.map
|
|
26
|
+
//# sourceMappingURL=XernerxInhibitor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XernerxInhibitor.d.ts","sourceRoot":"","sources":["../../src/build/XernerxInhibitor.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"XernerxInhibitor.d.ts","sourceRoot":"","sources":["../../src/build/XernerxInhibitor.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAC1I,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,gCAAgC,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACpK,OAAO,EAAE,qBAAqB,EAAc,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE3G;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACpC,SAAwB,EAAE,SAAC;IAC3B,SAAwB,IAAI,SAAC;IAC7B,SAAwB,IAAI,EAAE,aAAa,CAAC;IAC5C,SAAwB,QAAQ,EAAE,WAAW,CAAC;IAC9C,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,EAAE,iBAAiB,CAAC;gBAE/B,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;IAe/D;;;;OAIG;IACU,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,6BAA6B,GAAG,gCAAgC,CAAC,EAC3J,WAAW,EAAE,cAAc,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,6BAA6B,GAAG,gCAAgC,CAAC,EAC5I,IAAI,EACD,CAAC,CAAC,SAAS,cAAc,GACvB,uBAAuB,GACvB,CAAC,SAAS,uBAAuB,GACjC,qBAAqB,GACrB,CAAC,SAAS,6BAA6B,GACvC,uBAAuB,CAAC,MAAM,GAAG,SAAS,CAAC,GAC3C,KAAK,CAAC,GACR,IAAI,EACP,OAAO,EAAE,mBAAmB,GAAG,qBAAqB,GAAG,qBAAqB,GAC1E,OAAO,CAAC,GAAG,CAAC;CAKf"}
|
|
@@ -7,24 +7,24 @@ import { XernerxLog } from '../main.js';
|
|
|
7
7
|
* @param {InhibitorOptions} options - The inhibitor options.
|
|
8
8
|
*/
|
|
9
9
|
export default class XernerxInhibitor {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
10
|
+
constructor(id, options) {
|
|
11
|
+
this.id = id;
|
|
12
|
+
z.object({
|
|
13
|
+
name: z.string(),
|
|
14
|
+
type: z.string(),
|
|
15
|
+
}).parse(options);
|
|
16
|
+
this.name = options.name;
|
|
17
|
+
this.type = options.type;
|
|
18
|
+
this.client = this.client;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @description The check rule
|
|
22
|
+
* @param interaction - The interaction with the inhibitor, can be message and interaction
|
|
23
|
+
* @param args - The arguments parsed with this command
|
|
24
|
+
*/
|
|
25
|
+
async check(interaction, args, command) {
|
|
26
|
+
new XernerxLog(this.client).error(`${this.id} doesn't have a check rule.`);
|
|
27
|
+
return await this.client.emit('commandError', interaction, `${this.name} doesn't have a check rule.`, this, this.filetype);
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=XernerxInhibitor.js.map
|
|
30
|
+
//# sourceMappingURL=XernerxInhibitor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XernerxInhibitor.js","sourceRoot":"","sources":["../../src/build/XernerxInhibitor.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,
|
|
1
|
+
{"version":3,"file":"XernerxInhibitor.js","sourceRoot":"","sources":["../../src/build/XernerxInhibitor.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAyB,UAAU,EAA8C,MAAM,YAAY,CAAC;AAE3G;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAQpC,YAAmB,EAAU,EAAE,OAAgC;QAC9D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC,MAAM,CAAC;YACR,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SAChB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CACjB,WAA4I,EAC5I,IAQO,EACP,OAA4E;QAE5E,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,EAAE,6BAA6B,CAAC,CAAC;QAE3E,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,6BAA6B,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5H,CAAC;CACD","sourcesContent":["/** @format */\n\nimport { z } from 'zod';\n\nimport { XernerxInhibitorOptions, MessageCommandArguments, SlashCommandArguments, ContextCommandArguments } from '../types/interfaces.js';\nimport { InhibitorType, XernerxInteraction } from '../types/types.js';\nimport { XernerxClientType, XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';\nimport { XernerxContextCommand, XernerxLog, XernerxMessageCommand, XernerxSlashCommand } from '../main.js';\n\n/**\n * @description - The inhibitor builder for inhibitors.\n * @param {String} id - The unique ID of the inhibitor.\n * @param {InhibitorOptions} options - The inhibitor options.\n */\nexport default class XernerxInhibitor {\n\tpublic declare readonly id;\n\tpublic declare readonly name;\n\tpublic declare readonly type: InhibitorType;\n\tpublic declare readonly filetype: 'Inhibitor';\n\tpublic declare readonly filepath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: XernerxInhibitorOptions) {\n\t\tthis.id = id;\n\n\t\tz.object({\n\t\t\tname: z.string(),\n\t\t\ttype: z.string(),\n\t\t}).parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.type = options.type;\n\n\t\tthis.client = this.client;\n\t}\n\n\t/**\n\t * @description The check rule\n\t * @param interaction - The interaction with the inhibitor, can be message and interaction\n\t * @param args - The arguments parsed with this command\n\t */\n\tpublic async check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(\n\t\tinteraction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\targs:\n\t\t\t| (T extends XernerxMessage\n\t\t\t\t\t? MessageCommandArguments\n\t\t\t\t\t: T extends XernerxSlashInteraction\n\t\t\t\t\t? SlashCommandArguments\n\t\t\t\t\t: T extends XernerxUserContextInteraction\n\t\t\t\t\t? ContextCommandArguments<'user' | 'message'>\n\t\t\t\t\t: never)\n\t\t\t| null,\n\t\tcommand: XernerxSlashCommand | XernerxMessageCommand | XernerxContextCommand\n\t): Promise<any> {\n\t\tnew XernerxLog(this.client).error(`${this.id} doesn't have a check rule.`);\n\n\t\treturn await this.client.emit('commandError', interaction, `${this.name} doesn't have a check rule.`, this, this.filetype);\n\t}\n}\n"]}
|
|
@@ -2,57 +2,51 @@
|
|
|
2
2
|
import { XernerxClientType, XernerxMessage } from '../types/extenders.js';
|
|
3
3
|
import { MessageCommandArguments, MessageCommandOptions } from '../types/interfaces.js';
|
|
4
4
|
export default class XernerxMessageCommand {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
* @description Runs the execution rule
|
|
53
|
-
* @param message - The message event emitted on this command
|
|
54
|
-
* @param options - The args and flags parsed on this command
|
|
55
|
-
*/
|
|
56
|
-
exec(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<any>;
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly aliases: string[] | undefined;
|
|
8
|
+
readonly regex: RegExp | undefined;
|
|
9
|
+
readonly prefix: string | string[] | undefined;
|
|
10
|
+
readonly description: string | null | undefined;
|
|
11
|
+
readonly usage: string | null | undefined;
|
|
12
|
+
readonly info: string | null | undefined;
|
|
13
|
+
readonly separator: string | undefined;
|
|
14
|
+
readonly args: import("../main.js").MessageCommandArgumentOptions[] | undefined;
|
|
15
|
+
readonly flags: import("../main.js").MessageCommandFlagOptions[] | undefined;
|
|
16
|
+
readonly category: string | null | undefined;
|
|
17
|
+
readonly cooldown: number | null | undefined;
|
|
18
|
+
readonly ignore: {
|
|
19
|
+
owner?: boolean | undefined;
|
|
20
|
+
users?: string[] | undefined;
|
|
21
|
+
channels?: string[] | undefined;
|
|
22
|
+
guilds?: string[] | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
readonly strict: {
|
|
25
|
+
owner?: boolean | undefined;
|
|
26
|
+
users?: string[] | undefined;
|
|
27
|
+
channels?: string[] | undefined;
|
|
28
|
+
guilds?: string[] | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
readonly permissions: {
|
|
31
|
+
user?: string[] | import("../main.js").PermissionNames[] | undefined;
|
|
32
|
+
client?: string[] | import("../main.js").PermissionNames[] | undefined;
|
|
33
|
+
dm?: boolean | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
readonly filetype: 'MessageCommand';
|
|
36
|
+
readonly filepath: string;
|
|
37
|
+
readonly client: XernerxClientType;
|
|
38
|
+
constructor(id: string, options: MessageCommandOptions);
|
|
39
|
+
/**
|
|
40
|
+
* @description Checks for conditions before running the command
|
|
41
|
+
* @param message - The message event emitted on this command
|
|
42
|
+
* @param options - The args and flags parsed on this command
|
|
43
|
+
*/
|
|
44
|
+
conditions(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<any>;
|
|
45
|
+
/**
|
|
46
|
+
* @description Runs the execution rule
|
|
47
|
+
* @param message - The message event emitted on this command
|
|
48
|
+
* @param options - The args and flags parsed on this command
|
|
49
|
+
*/
|
|
50
|
+
exec(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<any>;
|
|
57
51
|
}
|
|
58
|
-
//# sourceMappingURL=XernerxMessageCommand.d.ts.map
|
|
52
|
+
//# sourceMappingURL=XernerxMessageCommand.d.ts.map
|