xernerx 4.4.17 → 4.4.18
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/dist/build/ContextCommandBuilder.d.ts +23 -31
- package/dist/build/ContextCommandBuilder.js +39 -39
- package/dist/build/EventBuilder.d.ts +1 -1
- package/dist/build/EventBuilder.js +2 -2
- package/dist/build/InhibitorBuilder.d.ts +2 -11
- package/dist/build/InhibitorBuilder.js +2 -2
- package/dist/build/MessageCommandBuilder.d.ts +20 -26
- package/dist/build/MessageCommandBuilder.js +34 -34
- package/dist/build/SlashCommandBuilder.d.ts +25 -39
- package/dist/build/SlashCommandBuilder.js +48 -48
- package/dist/client/XernerxClient.d.ts +22 -30
- package/dist/client/XernerxClient.js +33 -33
- package/dist/client/XernerxShardClient.d.ts +1 -1
- package/dist/client/XernerxShardClient.js +13 -15
- package/dist/functions/delay.d.ts +1 -1
- package/dist/functions/delay.js +1 -1
- package/dist/functions/deploy.d.ts +1 -1
- package/dist/functions/deploy.js +20 -15
- package/dist/functions/isOwner.d.ts +1 -1
- package/dist/functions/isOwner.js +1 -1
- package/dist/functions/isVoter.d.ts +1 -1
- package/dist/functions/isVoter.js +1 -1
- package/dist/functions/load.d.ts +1 -1
- package/dist/functions/load.js +3 -2
- package/dist/functions/reload.d.ts +1 -1
- package/dist/functions/reload.js +12 -9
- package/dist/functions/sendWebhook.d.ts +1 -1
- package/dist/functions/sendWebhook.js +3 -2
- package/dist/functions/setPresence.d.ts +2 -2
- package/dist/functions/setPresence.js +11 -12
- package/dist/functions/xernerxUser.d.ts +1 -1
- package/dist/functions/xernerxUser.js +1 -1
- package/dist/handlers/CommandHandler.d.ts +1 -1
- package/dist/handlers/CommandHandler.js +109 -86
- package/dist/handlers/CommandHandler.js.map +1 -1
- package/dist/handlers/EventHandler.d.ts +1 -1
- package/dist/handlers/EventHandler.js +3 -3
- package/dist/handlers/ExtensionHandler.d.ts +1 -1
- package/dist/handlers/ExtensionHandler.js +5 -3
- package/dist/handlers/Handler.d.ts +1 -1
- package/dist/handlers/Handler.js +16 -6
- package/dist/handlers/InhibitorHandler.d.ts +1 -1
- package/dist/handlers/InhibitorHandler.js +3 -3
- package/dist/handlers/WebhookHandler.d.ts +4 -2
- package/dist/handlers/WebhookHandler.js +6 -9
- 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 +63 -48
- package/dist/tools/XernerxError.d.ts +1 -1
- package/dist/tools/XernerxError.js +1 -1
- package/dist/tools/XernerxLog.d.ts +1 -1
- package/dist/tools/XernerxLog.js +2 -7
- package/dist/types/extenders.d.ts +9 -5
- package/dist/types/extenders.js +1 -1
- package/dist/types/interfaces.d.ts +6 -9
- 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 +4 -4
- package/dist/utils/ClientUtil.js +14 -8
- package/dist/utils/InteractionUtil.d.ts +2 -2
- package/dist/utils/InteractionUtil.js +1 -1
- package/dist/utils/MessageUtil.d.ts +2 -2
- package/dist/utils/MessageUtil.js +9 -5
- package/dist/utils/Util.d.ts +1 -1
- package/dist/utils/Util.js +1 -1
- package/dist/validators/commandValidation.d.ts +2 -5
- package/dist/validators/commandValidation.js +29 -19
- package/dist/validators/inhibitorValidations.d.ts +3 -19
- package/dist/validators/inhibitorValidations.js +2 -2
- package/package.json +1 -1
|
@@ -12,40 +12,32 @@ export default class ContextCommandBuilder {
|
|
|
12
12
|
readonly info: string | null | undefined;
|
|
13
13
|
readonly category: string | null | undefined;
|
|
14
14
|
readonly cooldown: number | null | undefined;
|
|
15
|
-
readonly ignore:
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| undefined;
|
|
23
|
-
|
|
24
|
-
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| undefined;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
| undefined;
|
|
38
|
-
readonly defer:
|
|
39
|
-
| {
|
|
40
|
-
reply?: boolean | undefined;
|
|
41
|
-
ephemeral?: boolean | undefined;
|
|
42
|
-
fetchReply?: boolean | undefined;
|
|
43
|
-
}
|
|
44
|
-
| 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;
|
|
45
37
|
readonly fileType: 'ContextCommand';
|
|
46
38
|
readonly filePath: string;
|
|
47
39
|
readonly client: typeof XernerxClient;
|
|
48
40
|
constructor(id: string, options: ContextCommandOptions);
|
|
49
41
|
exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<void | any | T>;
|
|
50
42
|
}
|
|
51
|
-
//# sourceMappingURL=ContextCommandBuilder.d.ts.map
|
|
43
|
+
//# sourceMappingURL=ContextCommandBuilder.d.ts.map
|
|
@@ -11,44 +11,44 @@ export default class ContextCommandBuilder {
|
|
|
11
11
|
this.data.setDMPermission(options.permissions?.dm || null);
|
|
12
12
|
options = z
|
|
13
13
|
.object({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
.default({}),
|
|
29
|
-
strict: z
|
|
30
|
-
.object({
|
|
31
|
-
owner: z.boolean().default(false),
|
|
32
|
-
users: z.array(z.string()).default([]),
|
|
33
|
-
channels: z.array(z.string()).default([]),
|
|
34
|
-
guilds: z.array(z.string()).default([]),
|
|
35
|
-
})
|
|
36
|
-
.default({}),
|
|
37
|
-
permissions: z
|
|
38
|
-
.object({
|
|
39
|
-
user: z.array(z.string()).default([]),
|
|
40
|
-
client: z.array(z.string()).default([]),
|
|
41
|
-
dm: z.boolean().default(true),
|
|
42
|
-
})
|
|
43
|
-
.default({}),
|
|
44
|
-
defer: z
|
|
45
|
-
.object({
|
|
46
|
-
reply: z.boolean().default(false),
|
|
47
|
-
ephemeral: z.boolean().default(false),
|
|
48
|
-
fetch: z.boolean().default(false),
|
|
49
|
-
})
|
|
50
|
-
.default({}),
|
|
14
|
+
name: z.string(),
|
|
15
|
+
type: z.enum(['user', 'message']),
|
|
16
|
+
description: z.string().or(z.null()).default(null),
|
|
17
|
+
usage: z.string().or(z.null()).default(null),
|
|
18
|
+
info: z.string().or(z.null()).default(null),
|
|
19
|
+
category: z.string().or(z.null()).default(null),
|
|
20
|
+
cooldown: z.number().or(z.null()).default(null),
|
|
21
|
+
ignore: z
|
|
22
|
+
.object({
|
|
23
|
+
owner: z.boolean().default(false),
|
|
24
|
+
users: z.array(z.string()).default([]),
|
|
25
|
+
channels: z.array(z.string()).default([]),
|
|
26
|
+
guilds: z.array(z.string()).default([]),
|
|
51
27
|
})
|
|
28
|
+
.default({}),
|
|
29
|
+
strict: z
|
|
30
|
+
.object({
|
|
31
|
+
owner: z.boolean().default(false),
|
|
32
|
+
users: z.array(z.string()).default([]),
|
|
33
|
+
channels: z.array(z.string()).default([]),
|
|
34
|
+
guilds: z.array(z.string()).default([]),
|
|
35
|
+
})
|
|
36
|
+
.default({}),
|
|
37
|
+
permissions: z
|
|
38
|
+
.object({
|
|
39
|
+
user: z.array(z.string()).default([]),
|
|
40
|
+
client: z.array(z.string()).default([]),
|
|
41
|
+
dm: z.boolean().default(true),
|
|
42
|
+
})
|
|
43
|
+
.default({}),
|
|
44
|
+
defer: z
|
|
45
|
+
.object({
|
|
46
|
+
reply: z.boolean().default(false),
|
|
47
|
+
ephemeral: z.boolean().default(false),
|
|
48
|
+
fetch: z.boolean().default(false),
|
|
49
|
+
})
|
|
50
|
+
.default({}),
|
|
51
|
+
})
|
|
52
52
|
.parse(options);
|
|
53
53
|
this.name = options.name;
|
|
54
54
|
this.type = options.type;
|
|
@@ -63,6 +63,6 @@ export default class ContextCommandBuilder {
|
|
|
63
63
|
this.defer = options.defer;
|
|
64
64
|
this.client = XernerxClient;
|
|
65
65
|
}
|
|
66
|
-
async exec(interaction, args) {}
|
|
66
|
+
async exec(interaction, args) { }
|
|
67
67
|
}
|
|
68
|
-
//# sourceMappingURL=ContextCommandBuilder.js.map
|
|
68
|
+
//# sourceMappingURL=ContextCommandBuilder.js.map
|
|
@@ -25,6 +25,6 @@ export default class EventBuilder {
|
|
|
25
25
|
* @description run your custom event here.
|
|
26
26
|
* TODO - update description
|
|
27
27
|
*/
|
|
28
|
-
async run(...args) {}
|
|
28
|
+
async run(...args) { }
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=EventBuilder.js.map
|
|
30
|
+
//# sourceMappingURL=EventBuilder.js.map
|
|
@@ -15,15 +15,6 @@ export default class InhibitorBuilder {
|
|
|
15
15
|
readonly filePath: string;
|
|
16
16
|
readonly client: typeof XernerxClient;
|
|
17
17
|
constructor(id: string, options: InhibitorBuilderOptions);
|
|
18
|
-
check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(
|
|
19
|
-
interaction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
|
|
20
|
-
args: T extends XernerxMessage
|
|
21
|
-
? MessageCommandArguments
|
|
22
|
-
: T extends XernerxSlashInteraction
|
|
23
|
-
? SlashCommandArguments
|
|
24
|
-
: T extends XernerxUserContextInteraction
|
|
25
|
-
? XernerxUserContextInteraction
|
|
26
|
-
: XernerxMessageContextInteraction | null
|
|
27
|
-
): Promise<void | any | T>;
|
|
18
|
+
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 ? XernerxUserContextInteraction : XernerxMessageContextInteraction | null): Promise<void | any | T>;
|
|
28
19
|
}
|
|
29
|
-
//# sourceMappingURL=InhibitorBuilder.d.ts.map
|
|
20
|
+
//# sourceMappingURL=InhibitorBuilder.d.ts.map
|
|
@@ -16,6 +16,6 @@ export default class InhibitorBuilder {
|
|
|
16
16
|
this.type = options.type;
|
|
17
17
|
this.client = XernerxClient;
|
|
18
18
|
}
|
|
19
|
-
async check(interaction, args) {}
|
|
19
|
+
async check(interaction, args) { }
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=InhibitorBuilder.js.map
|
|
21
|
+
//# sourceMappingURL=InhibitorBuilder.js.map
|
|
@@ -11,33 +11,27 @@ export default class MessageCommandBuilder {
|
|
|
11
11
|
readonly usage: string | null | undefined;
|
|
12
12
|
readonly info: string | null | undefined;
|
|
13
13
|
readonly separator: string | undefined;
|
|
14
|
-
readonly args: import(
|
|
15
|
-
readonly flags: import(
|
|
14
|
+
readonly args: import("../types/interfaces.js").MessageCommandArgumentOptions[] | undefined;
|
|
15
|
+
readonly flags: import("../types/interfaces.js").MessageCommandFlagOptions[] | undefined;
|
|
16
16
|
readonly category: string | null | undefined;
|
|
17
17
|
readonly cooldown: number | null | undefined;
|
|
18
|
-
readonly ignore:
|
|
19
|
-
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| undefined;
|
|
26
|
-
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
| undefined;
|
|
34
|
-
|
|
35
|
-
| {
|
|
36
|
-
user?: string[] | import('../main.js').PermissionNames[] | undefined;
|
|
37
|
-
client?: string[] | import('../main.js').PermissionNames[] | undefined;
|
|
38
|
-
dm?: boolean | undefined;
|
|
39
|
-
}
|
|
40
|
-
| 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;
|
|
41
35
|
readonly fileType: 'MessageCommand';
|
|
42
36
|
readonly filePath: string;
|
|
43
37
|
readonly client: typeof XernerxClient;
|
|
@@ -45,4 +39,4 @@ export default class MessageCommandBuilder {
|
|
|
45
39
|
conditions<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T>;
|
|
46
40
|
exec<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T>;
|
|
47
41
|
}
|
|
48
|
-
//# sourceMappingURL=MessageCommandBuilder.d.ts.map
|
|
42
|
+
//# sourceMappingURL=MessageCommandBuilder.d.ts.map
|
|
@@ -8,38 +8,38 @@ export default class MessageCommandBuilder {
|
|
|
8
8
|
this.flags = options.flags;
|
|
9
9
|
options = z
|
|
10
10
|
.object({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
.default({}),
|
|
27
|
-
strict: z
|
|
28
|
-
.object({
|
|
29
|
-
owner: z.boolean().default(false),
|
|
30
|
-
users: z.array(z.string()).default([]),
|
|
31
|
-
channels: z.array(z.string()).default([]),
|
|
32
|
-
guilds: z.array(z.string()).default([]),
|
|
33
|
-
})
|
|
34
|
-
.default({}),
|
|
35
|
-
permissions: z
|
|
36
|
-
.object({
|
|
37
|
-
user: z.array(z.string()).default([]),
|
|
38
|
-
client: z.array(z.string()).default([]),
|
|
39
|
-
dm: z.boolean().default(true),
|
|
40
|
-
})
|
|
41
|
-
.default({}),
|
|
11
|
+
name: z.string(),
|
|
12
|
+
aliases: z.array(z.string()).default([]),
|
|
13
|
+
description: z.string().or(z.null()).default(null),
|
|
14
|
+
usage: z.string().or(z.null()).default(null),
|
|
15
|
+
info: z.string().or(z.null()).default(null),
|
|
16
|
+
category: z.string().or(z.null()).default(null),
|
|
17
|
+
cooldown: z.number().or(z.null()).default(null),
|
|
18
|
+
prefix: z.array(z.string()).or(z.string()).default([]),
|
|
19
|
+
ignore: z
|
|
20
|
+
.object({
|
|
21
|
+
owner: z.boolean().default(false),
|
|
22
|
+
users: z.array(z.string()).default([]),
|
|
23
|
+
channels: z.array(z.string()).default([]),
|
|
24
|
+
guilds: z.array(z.string()).default([]),
|
|
42
25
|
})
|
|
26
|
+
.default({}),
|
|
27
|
+
strict: z
|
|
28
|
+
.object({
|
|
29
|
+
owner: z.boolean().default(false),
|
|
30
|
+
users: z.array(z.string()).default([]),
|
|
31
|
+
channels: z.array(z.string()).default([]),
|
|
32
|
+
guilds: z.array(z.string()).default([]),
|
|
33
|
+
})
|
|
34
|
+
.default({}),
|
|
35
|
+
permissions: z
|
|
36
|
+
.object({
|
|
37
|
+
user: z.array(z.string()).default([]),
|
|
38
|
+
client: z.array(z.string()).default([]),
|
|
39
|
+
dm: z.boolean().default(true),
|
|
40
|
+
})
|
|
41
|
+
.default({}),
|
|
42
|
+
})
|
|
43
43
|
.parse(options);
|
|
44
44
|
this.name = options.name;
|
|
45
45
|
this.aliases = options.aliases;
|
|
@@ -55,7 +55,7 @@ export default class MessageCommandBuilder {
|
|
|
55
55
|
this.permissions = options.permissions;
|
|
56
56
|
this.client = XernerxClient;
|
|
57
57
|
}
|
|
58
|
-
async conditions(message, { args, flags }) {}
|
|
59
|
-
async exec(message, { args, flags }) {}
|
|
58
|
+
async conditions(message, { args, flags }) { }
|
|
59
|
+
async exec(message, { args, flags }) { }
|
|
60
60
|
}
|
|
61
|
-
//# sourceMappingURL=MessageCommandBuilder.js.map
|
|
61
|
+
//# sourceMappingURL=MessageCommandBuilder.js.map
|
|
@@ -12,51 +12,37 @@ export default class SlashCommandBuilder {
|
|
|
12
12
|
readonly info: string | null | undefined;
|
|
13
13
|
readonly category: string | null | undefined;
|
|
14
14
|
readonly cooldown: number | null | undefined;
|
|
15
|
-
readonly ignore:
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| undefined;
|
|
23
|
-
|
|
24
|
-
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| undefined;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
| undefined;
|
|
38
|
-
readonly defer:
|
|
39
|
-
| {
|
|
40
|
-
reply?: boolean | undefined;
|
|
41
|
-
ephemeral?: boolean | undefined;
|
|
42
|
-
fetchReply?: boolean | undefined;
|
|
43
|
-
}
|
|
44
|
-
| 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("../types/types.js").PermissionNames[] | undefined;
|
|
29
|
+
client?: string[] | import("../types/types.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;
|
|
45
37
|
readonly fileType: 'SlashCommand';
|
|
46
38
|
readonly filePath: string;
|
|
47
39
|
readonly client: typeof XernerxClient;
|
|
48
40
|
constructor(id: string, options: SlashCommandOptions);
|
|
49
41
|
autocomplete<T>(interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, focused: T, options: T[]): Promise<void | any | T>;
|
|
50
|
-
conditions<T>(
|
|
51
|
-
|
|
52
|
-
{ args, subcommand, group }: SlashCommandArguments
|
|
53
|
-
): Promise<void | any | T>;
|
|
54
|
-
exec<T>(
|
|
55
|
-
interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
|
|
56
|
-
{ args, subcommand, group }: SlashCommandArguments
|
|
57
|
-
): Promise<void | any | T>;
|
|
42
|
+
conditions<T>(interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, { args, subcommand, group }: SlashCommandArguments): Promise<void | any | T>;
|
|
43
|
+
exec<T>(interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, { args, subcommand, group }: SlashCommandArguments): Promise<void | any | T>;
|
|
58
44
|
private addArguments;
|
|
59
45
|
private addSubcommands;
|
|
60
46
|
private addSubcommandGroups;
|
|
61
47
|
}
|
|
62
|
-
//# sourceMappingURL=SlashCommandBuilder.d.ts.map
|
|
48
|
+
//# sourceMappingURL=SlashCommandBuilder.d.ts.map
|
|
@@ -21,44 +21,44 @@ export default class SlashCommandBuilder {
|
|
|
21
21
|
}
|
|
22
22
|
options = z
|
|
23
23
|
.object({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
.default({}),
|
|
39
|
-
strict: z
|
|
40
|
-
.object({
|
|
41
|
-
owner: z.boolean().default(false),
|
|
42
|
-
users: z.array(z.string()).default([]),
|
|
43
|
-
channels: z.array(z.string()).default([]),
|
|
44
|
-
guilds: z.array(z.string()).default([]),
|
|
45
|
-
})
|
|
46
|
-
.default({}),
|
|
47
|
-
permissions: z
|
|
48
|
-
.object({
|
|
49
|
-
user: z.array(z.string()).default([]),
|
|
50
|
-
client: z.array(z.string()).default([]),
|
|
51
|
-
dm: z.boolean().default(true),
|
|
52
|
-
})
|
|
53
|
-
.default({}),
|
|
54
|
-
defer: z
|
|
55
|
-
.object({
|
|
56
|
-
reply: z.boolean().default(false),
|
|
57
|
-
ephemeral: z.boolean().default(false),
|
|
58
|
-
fetch: z.boolean().default(false),
|
|
59
|
-
})
|
|
60
|
-
.default({}),
|
|
24
|
+
name: z.string(),
|
|
25
|
+
description: z.string(),
|
|
26
|
+
usage: z.string().or(z.null()).default(null),
|
|
27
|
+
info: z.string().or(z.null()).default(null),
|
|
28
|
+
category: z.string().or(z.null()).default(null),
|
|
29
|
+
number: z.number().or(z.null()).default(null),
|
|
30
|
+
channelType: z.array(z.number()).or(z.null()).default(null),
|
|
31
|
+
ignore: z
|
|
32
|
+
.object({
|
|
33
|
+
owner: z.boolean().default(false),
|
|
34
|
+
users: z.array(z.string()).default([]),
|
|
35
|
+
channels: z.array(z.string()).default([]),
|
|
36
|
+
guilds: z.array(z.string()).default([]),
|
|
61
37
|
})
|
|
38
|
+
.default({}),
|
|
39
|
+
strict: z
|
|
40
|
+
.object({
|
|
41
|
+
owner: z.boolean().default(false),
|
|
42
|
+
users: z.array(z.string()).default([]),
|
|
43
|
+
channels: z.array(z.string()).default([]),
|
|
44
|
+
guilds: z.array(z.string()).default([]),
|
|
45
|
+
})
|
|
46
|
+
.default({}),
|
|
47
|
+
permissions: z
|
|
48
|
+
.object({
|
|
49
|
+
user: z.array(z.string()).default([]),
|
|
50
|
+
client: z.array(z.string()).default([]),
|
|
51
|
+
dm: z.boolean().default(true),
|
|
52
|
+
})
|
|
53
|
+
.default({}),
|
|
54
|
+
defer: z
|
|
55
|
+
.object({
|
|
56
|
+
reply: z.boolean().default(false),
|
|
57
|
+
ephemeral: z.boolean().default(false),
|
|
58
|
+
fetch: z.boolean().default(false),
|
|
59
|
+
})
|
|
60
|
+
.default({}),
|
|
61
|
+
})
|
|
62
62
|
.parse(options);
|
|
63
63
|
this.name = options.name;
|
|
64
64
|
this.description = options.description;
|
|
@@ -72,9 +72,9 @@ export default class SlashCommandBuilder {
|
|
|
72
72
|
this.defer = options.defer;
|
|
73
73
|
this.client = XernerxClient;
|
|
74
74
|
}
|
|
75
|
-
async autocomplete(interaction, focused, options) {}
|
|
76
|
-
async conditions(interaction, { args, subcommand, group }) {}
|
|
77
|
-
async exec(interaction, { args, subcommand, group }) {}
|
|
75
|
+
async autocomplete(interaction, focused, options) { }
|
|
76
|
+
async conditions(interaction, { args, subcommand, group }) { }
|
|
77
|
+
async exec(interaction, { args, subcommand, group }) { }
|
|
78
78
|
addArguments(command, args) {
|
|
79
79
|
for (const argument of args) {
|
|
80
80
|
let slashCommandArgumentType = `${argument.type.charAt(0).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;
|
|
@@ -85,11 +85,9 @@ export default class SlashCommandBuilder {
|
|
|
85
85
|
.setRequired(argument.required || false);
|
|
86
86
|
if (slashCommandArgumentType === 'String') {
|
|
87
87
|
if (argument.choices)
|
|
88
|
-
option.setChoices(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})
|
|
92
|
-
);
|
|
88
|
+
option.setChoices(...argument.choices.map((choices) => {
|
|
89
|
+
return { name: Object.keys(choices).at(0), value: Object.values(choices).at(0) };
|
|
90
|
+
}));
|
|
93
91
|
option.setAutocomplete(argument.autocomplete || false);
|
|
94
92
|
}
|
|
95
93
|
return option;
|
|
@@ -99,16 +97,18 @@ export default class SlashCommandBuilder {
|
|
|
99
97
|
addSubcommands(method, subcommands) {
|
|
100
98
|
for (const subcommand of subcommands) {
|
|
101
99
|
let sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);
|
|
102
|
-
if (subcommand.args && subcommand?.args?.length > 0)
|
|
100
|
+
if (subcommand.args && subcommand?.args?.length > 0)
|
|
101
|
+
this.addArguments(sub, subcommand.args);
|
|
103
102
|
method.addSubcommand(sub);
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
addSubcommandGroups(groups) {
|
|
107
106
|
for (const group of groups) {
|
|
108
107
|
let subcommandGroup = new SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);
|
|
109
|
-
if (group.subcommands?.length > 0)
|
|
108
|
+
if (group.subcommands?.length > 0)
|
|
109
|
+
this.addSubcommands(subcommandGroup, group.subcommands);
|
|
110
110
|
this.data.addSubcommandGroup(subcommandGroup);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
//# sourceMappingURL=SlashCommandBuilder.js.map
|
|
114
|
+
//# sourceMappingURL=SlashCommandBuilder.js.map
|
|
@@ -7,35 +7,27 @@ export default class XernerxClient extends Client {
|
|
|
7
7
|
ownerId: (string | string[]) & (string | string[] | undefined);
|
|
8
8
|
local?: string | undefined;
|
|
9
9
|
global?: boolean | undefined;
|
|
10
|
-
permissions?:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
| undefined;
|
|
33
|
-
cooldown?:
|
|
34
|
-
| {
|
|
35
|
-
command: number;
|
|
36
|
-
cache: number;
|
|
37
|
-
}
|
|
38
|
-
| undefined;
|
|
10
|
+
permissions?: {
|
|
11
|
+
client: string[];
|
|
12
|
+
user: string[];
|
|
13
|
+
dm: boolean;
|
|
14
|
+
} | undefined;
|
|
15
|
+
ignore?: {
|
|
16
|
+
owner: boolean;
|
|
17
|
+
users: string[];
|
|
18
|
+
channels: string[];
|
|
19
|
+
guilds: string[];
|
|
20
|
+
} | undefined;
|
|
21
|
+
log?: {
|
|
22
|
+
ready: boolean;
|
|
23
|
+
error: boolean;
|
|
24
|
+
info: boolean;
|
|
25
|
+
table: string[] | null;
|
|
26
|
+
} | undefined;
|
|
27
|
+
cooldown?: {
|
|
28
|
+
command: number;
|
|
29
|
+
cache: number;
|
|
30
|
+
} | undefined;
|
|
39
31
|
};
|
|
40
32
|
readonly config: Record<string, unknown> | null;
|
|
41
33
|
readonly commands: XernerxCommands;
|
|
@@ -48,4 +40,4 @@ export default class XernerxClient extends Client {
|
|
|
48
40
|
constructor(discordOptions: ClientOptions, xernerxOptions: XernerxOptions, config?: Record<string, unknown>);
|
|
49
41
|
connect(token: string): void;
|
|
50
42
|
}
|
|
51
|
-
//# sourceMappingURL=XernerxClient.d.ts.map
|
|
43
|
+
//# sourceMappingURL=XernerxClient.d.ts.map
|