xernerx 4.5.6 → 4.5.7
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/XernerxContextCommand.d.ts +46 -44
- package/dist/build/XernerxContextCommand.js +64 -62
- package/dist/build/XernerxEvent.d.ts +16 -14
- package/dist/build/XernerxEvent.js +21 -19
- package/dist/build/XernerxInhibitor.d.ts +19 -17
- package/dist/build/XernerxInhibitor.js +13 -11
- package/dist/build/XernerxMessageCommand.d.ts +44 -42
- package/dist/build/XernerxMessageCommand.js +58 -56
- package/dist/build/XernerxSlashCommand.d.ts +56 -54
- package/dist/build/XernerxSlashCommand.js +110 -108
- package/dist/client/XernerxClient.d.ts +46 -44
- package/dist/client/XernerxClient.js +75 -73
- package/dist/client/XernerxShardClient.d.ts +12 -10
- package/dist/client/XernerxShardClient.js +50 -48
- package/dist/functions/deploy.d.ts +2 -0
- package/dist/functions/deploy.js +32 -30
- package/dist/functions/load.d.ts +2 -0
- package/dist/functions/load.js +29 -27
- package/dist/functions/reload.d.ts +2 -0
- package/dist/functions/reload.js +36 -34
- package/dist/functions/sendWebhook.d.ts +2 -0
- package/dist/functions/sendWebhook.js +12 -10
- package/dist/functions/setPresence.d.ts +2 -0
- package/dist/functions/setPresence.js +19 -17
- package/dist/functions/xernerxUser.d.ts +2 -0
- package/dist/functions/xernerxUser.js +10 -8
- package/dist/handlers/CommandHandler.d.ts +10 -8
- package/dist/handlers/CommandHandler.js +241 -239
- package/dist/handlers/EventHandler.d.ts +4 -2
- package/dist/handlers/EventHandler.js +20 -18
- package/dist/handlers/ExtensionHandler.d.ts +4 -2
- package/dist/handlers/ExtensionHandler.js +19 -17
- package/dist/handlers/Handler.d.ts +9 -7
- package/dist/handlers/Handler.js +33 -31
- package/dist/handlers/InhibitorHandler.d.ts +4 -2
- package/dist/handlers/InhibitorHandler.js +20 -18
- package/dist/handlers/WebhookHandler.d.ts +5 -3
- package/dist/handlers/WebhookHandler.js +48 -46
- package/dist/main.d.ts +28 -26
- package/dist/main.js +28 -26
- package/dist/models/Arguments.d.ts +4 -2
- package/dist/models/Arguments.js +136 -134
- package/dist/tools/XernerxError.d.ts +6 -4
- package/dist/tools/XernerxError.js +10 -8
- package/dist/tools/XernerxLog.d.ts +14 -12
- package/dist/tools/XernerxLog.js +77 -80
- package/dist/types/extenders.d.ts +13 -11
- package/dist/types/extenders.js +2 -0
- package/dist/types/interfaces.d.ts +184 -172
- package/dist/types/interfaces.d.ts.map +1 -1
- package/dist/types/interfaces.js +2 -0
- package/dist/types/interfaces.js.map +1 -1
- package/dist/types/types.d.ts +173 -171
- package/dist/types/types.js +2 -0
- package/dist/utils/ClientUtil.d.ts +8 -5
- package/dist/utils/ClientUtil.d.ts.map +1 -1
- package/dist/utils/ClientUtil.js +45 -26
- package/dist/utils/ClientUtil.js.map +1 -1
- package/dist/utils/InteractionUtil.d.ts +11 -5
- package/dist/utils/InteractionUtil.d.ts.map +1 -1
- package/dist/utils/InteractionUtil.js +98 -8
- package/dist/utils/InteractionUtil.js.map +1 -1
- package/dist/utils/MessageUtil.d.ts +14 -9
- package/dist/utils/MessageUtil.d.ts.map +1 -1
- package/dist/utils/MessageUtil.js +131 -37
- package/dist/utils/MessageUtil.js.map +1 -1
- package/dist/utils/Util.d.ts +5 -3
- package/dist/utils/Util.js +9 -7
- package/dist/validators/commandValidation.d.ts +4 -2
- package/dist/validators/commandValidation.js +44 -42
- package/dist/validators/inhibitorValidations.d.ts +16 -14
- package/dist/validators/inhibitorValidations.js +32 -30
- package/package.json +1 -1
|
@@ -1,62 +1,64 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
1
3
|
import Discord from 'discord.js';
|
|
2
4
|
import XernerxClient from '../client/XernerxClient.js';
|
|
3
5
|
import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
4
6
|
import { SlashCommandArguments, SlashCommandOptions } from '../types/interfaces.js';
|
|
5
7
|
import { XernerxInteraction } from '../types/types.js';
|
|
6
8
|
export default class XernerxSlashCommand {
|
|
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
|
-
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly data: Discord.SlashCommandBuilder;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly usage: string | null | undefined;
|
|
14
|
+
readonly info: string | null | undefined;
|
|
15
|
+
readonly category: string | null | undefined;
|
|
16
|
+
readonly cooldown: number | null | undefined;
|
|
17
|
+
readonly ignore:
|
|
18
|
+
| {
|
|
19
|
+
owner?: boolean | undefined;
|
|
20
|
+
users?: string[] | undefined;
|
|
21
|
+
channels?: string[] | undefined;
|
|
22
|
+
guilds?: string[] | undefined;
|
|
23
|
+
}
|
|
24
|
+
| undefined;
|
|
25
|
+
readonly strict:
|
|
26
|
+
| {
|
|
27
|
+
owner?: boolean | undefined;
|
|
28
|
+
users?: string[] | undefined;
|
|
29
|
+
channels?: string[] | undefined;
|
|
30
|
+
guilds?: string[] | undefined;
|
|
31
|
+
}
|
|
32
|
+
| undefined;
|
|
33
|
+
readonly permissions:
|
|
34
|
+
| {
|
|
35
|
+
user?: string[] | import('../types/types.js').PermissionNames[] | undefined;
|
|
36
|
+
client?: string[] | import('../types/types.js').PermissionNames[] | undefined;
|
|
37
|
+
dm?: boolean | undefined;
|
|
38
|
+
}
|
|
39
|
+
| undefined;
|
|
40
|
+
readonly defer:
|
|
41
|
+
| {
|
|
42
|
+
reply?: boolean | undefined;
|
|
43
|
+
ephemeral?: boolean | undefined;
|
|
44
|
+
fetchReply?: boolean | undefined;
|
|
45
|
+
}
|
|
46
|
+
| undefined;
|
|
47
|
+
readonly fileType: 'SlashCommand';
|
|
48
|
+
readonly filePath: string;
|
|
49
|
+
readonly client: typeof XernerxClient;
|
|
50
|
+
constructor(id: string, options: SlashCommandOptions);
|
|
51
|
+
autocomplete<T>(interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, focused: T, options: T[]): Promise<void | any | T>;
|
|
52
|
+
conditions<T>(
|
|
53
|
+
interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
|
|
54
|
+
{ args, subcommand, group }: SlashCommandArguments
|
|
55
|
+
): Promise<void | any | T>;
|
|
56
|
+
exec<T>(
|
|
57
|
+
interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
|
|
58
|
+
{ args, subcommand, group }: SlashCommandArguments
|
|
59
|
+
): Promise<void | any | T>;
|
|
60
|
+
private addArguments;
|
|
61
|
+
private addSubcommands;
|
|
62
|
+
private addSubcommandGroups;
|
|
61
63
|
}
|
|
62
64
|
//# sourceMappingURL=XernerxSlashCommand.d.ts.map
|
|
@@ -1,114 +1,116 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
1
3
|
import Discord, { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from 'discord.js';
|
|
2
4
|
import { z } from 'zod';
|
|
3
5
|
import XernerxClient from '../client/XernerxClient.js';
|
|
4
6
|
export default class XernerxSlashCommand {
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
7
|
+
constructor(id, options) {
|
|
8
|
+
this.id = id;
|
|
9
|
+
this.data = new Discord.SlashCommandBuilder();
|
|
10
|
+
this.data.setName(options.name);
|
|
11
|
+
this.data.setNameLocalizations(options.nameLocalizations || null);
|
|
12
|
+
this.data.setDescription(options.description);
|
|
13
|
+
this.data.setDescriptionLocalizations(options.descriptionLocalizations || null);
|
|
14
|
+
this.data.setDMPermission(options.permissions?.dm || null);
|
|
15
|
+
if (options.args && options?.args?.length > 0) {
|
|
16
|
+
this.addArguments(this.data, options.args);
|
|
17
|
+
}
|
|
18
|
+
if (options.subcommands && options?.subcommands?.length > 0) {
|
|
19
|
+
this.addSubcommands(this.data, options.subcommands);
|
|
20
|
+
}
|
|
21
|
+
if (options.groups && options?.groups?.length > 0) {
|
|
22
|
+
this.addSubcommandGroups(options.groups);
|
|
23
|
+
}
|
|
24
|
+
options = z
|
|
25
|
+
.object({
|
|
26
|
+
name: z.string(),
|
|
27
|
+
description: z.string(),
|
|
28
|
+
usage: z.string().or(z.null()).default(null),
|
|
29
|
+
info: z.string().or(z.null()).default(null),
|
|
30
|
+
category: z.string().or(z.null()).default(null),
|
|
31
|
+
number: z.number().or(z.null()).default(null),
|
|
32
|
+
channelType: z.array(z.number()).or(z.null()).default(null),
|
|
33
|
+
ignore: z
|
|
34
|
+
.object({
|
|
35
|
+
owner: z.boolean().default(false),
|
|
36
|
+
users: z.array(z.string()).default([]),
|
|
37
|
+
channels: z.array(z.string()).default([]),
|
|
38
|
+
guilds: z.array(z.string()).default([]),
|
|
39
|
+
})
|
|
40
|
+
.default({}),
|
|
41
|
+
strict: z
|
|
42
|
+
.object({
|
|
43
|
+
owner: z.boolean().default(false),
|
|
44
|
+
users: z.array(z.string()).default([]),
|
|
45
|
+
channels: z.array(z.string()).default([]),
|
|
46
|
+
guilds: z.array(z.string()).default([]),
|
|
47
|
+
})
|
|
48
|
+
.default({}),
|
|
49
|
+
permissions: z
|
|
50
|
+
.object({
|
|
51
|
+
user: z.array(z.string()).default([]),
|
|
52
|
+
client: z.array(z.string()).default([]),
|
|
53
|
+
dm: z.boolean().default(true),
|
|
54
|
+
})
|
|
55
|
+
.default({}),
|
|
56
|
+
defer: z
|
|
57
|
+
.object({
|
|
58
|
+
reply: z.boolean().default(false),
|
|
59
|
+
ephemeral: z.boolean().default(false),
|
|
60
|
+
fetch: z.boolean().default(false),
|
|
61
|
+
})
|
|
62
|
+
.default({}),
|
|
63
|
+
})
|
|
64
|
+
.parse(options);
|
|
65
|
+
this.name = options.name;
|
|
66
|
+
this.description = options.description;
|
|
67
|
+
this.usage = options.usage;
|
|
68
|
+
this.info = options.info;
|
|
69
|
+
this.category = options.category;
|
|
70
|
+
this.cooldown = options.cooldown;
|
|
71
|
+
this.ignore = options.ignore;
|
|
72
|
+
this.strict = options.strict;
|
|
73
|
+
this.permissions = options.permissions;
|
|
74
|
+
this.defer = options.defer;
|
|
75
|
+
this.client = XernerxClient;
|
|
76
|
+
}
|
|
77
|
+
async autocomplete(interaction, focused, options) {}
|
|
78
|
+
async conditions(interaction, { args, subcommand, group }) {}
|
|
79
|
+
async exec(interaction, { args, subcommand, group }) {}
|
|
80
|
+
addArguments(command, args) {
|
|
81
|
+
for (const argument of args) {
|
|
82
|
+
let slashCommandArgumentType = `${argument.type.charAt(0).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;
|
|
83
|
+
command[`add${slashCommandArgumentType}Option`]((option) => {
|
|
84
|
+
option
|
|
85
|
+
.setName(argument.name)
|
|
86
|
+
.setDescription(argument.description)
|
|
87
|
+
.setRequired(argument.required || false);
|
|
88
|
+
if (slashCommandArgumentType === 'String') {
|
|
89
|
+
if (argument.choices)
|
|
90
|
+
option.setChoices(
|
|
91
|
+
...argument.choices.map((choices) => {
|
|
92
|
+
return { name: Object.keys(choices).at(0), value: Object.values(choices).at(0) };
|
|
93
|
+
})
|
|
94
|
+
);
|
|
95
|
+
option.setAutocomplete(argument.autocomplete || false);
|
|
96
|
+
}
|
|
97
|
+
return option;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
addSubcommands(method, subcommands) {
|
|
102
|
+
for (const subcommand of subcommands) {
|
|
103
|
+
let sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);
|
|
104
|
+
if (subcommand.args && subcommand?.args?.length > 0) this.addArguments(sub, subcommand.args);
|
|
105
|
+
method.addSubcommand(sub);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
addSubcommandGroups(groups) {
|
|
109
|
+
for (const group of groups) {
|
|
110
|
+
let subcommandGroup = new SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);
|
|
111
|
+
if (group.subcommands?.length > 0) this.addSubcommands(subcommandGroup, group.subcommands);
|
|
112
|
+
this.data.addSubcommandGroup(subcommandGroup);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
113
115
|
}
|
|
114
116
|
//# sourceMappingURL=XernerxSlashCommand.js.map
|
|
@@ -1,51 +1,53 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
1
3
|
import { Client, ClientOptions, Collection } from 'discord.js';
|
|
2
4
|
import { XernerxOptions, ModuleOptions, XernerxCommands, XernerxCache } from '../types/interfaces.js';
|
|
3
5
|
import ClientUtil from '../utils/ClientUtil.js';
|
|
4
6
|
import { XernerxInhibitor, XernerxEvent } from '../main.js';
|
|
5
7
|
export default class XernerxClient<T = unknown> extends Client {
|
|
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
|
-
|
|
8
|
+
readonly settings: {
|
|
9
|
+
ownerId: (string | string[]) & (string | string[] | undefined);
|
|
10
|
+
local: string;
|
|
11
|
+
global?: boolean | undefined;
|
|
12
|
+
permissions?:
|
|
13
|
+
| {
|
|
14
|
+
client: string[];
|
|
15
|
+
user: string[];
|
|
16
|
+
dm: boolean;
|
|
17
|
+
}
|
|
18
|
+
| undefined;
|
|
19
|
+
ignore?:
|
|
20
|
+
| {
|
|
21
|
+
owner: boolean;
|
|
22
|
+
users: string[];
|
|
23
|
+
channels: string[];
|
|
24
|
+
guilds: string[];
|
|
25
|
+
}
|
|
26
|
+
| undefined;
|
|
27
|
+
log?:
|
|
28
|
+
| {
|
|
29
|
+
ready: boolean;
|
|
30
|
+
error: boolean;
|
|
31
|
+
info: boolean;
|
|
32
|
+
table: string[] | null;
|
|
33
|
+
}
|
|
34
|
+
| undefined;
|
|
35
|
+
cooldown?:
|
|
36
|
+
| {
|
|
37
|
+
command: number;
|
|
38
|
+
cache: number;
|
|
39
|
+
}
|
|
40
|
+
| undefined;
|
|
41
|
+
};
|
|
42
|
+
readonly config: NonNullable<T> | null;
|
|
43
|
+
readonly commands: XernerxCommands;
|
|
44
|
+
readonly events: Collection<string, XernerxEvent>;
|
|
45
|
+
readonly inhibitors: Collection<string, XernerxInhibitor>;
|
|
46
|
+
readonly modules: ModuleOptions;
|
|
47
|
+
readonly util: ClientUtil;
|
|
48
|
+
readonly stats: Record<string, number>;
|
|
49
|
+
readonly cache: XernerxCache;
|
|
50
|
+
constructor(discordOptions: ClientOptions, xernerxOptions: XernerxOptions, config?: T);
|
|
51
|
+
connect(token: string): Promise<string>;
|
|
50
52
|
}
|
|
51
53
|
//# sourceMappingURL=XernerxClient.d.ts.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
1
3
|
import { Client, Collection } from 'discord.js';
|
|
2
4
|
import { z } from 'zod';
|
|
3
5
|
import CommandHandler from '../handlers/CommandHandler.js';
|
|
@@ -9,78 +11,78 @@ import ClientUtil from '../utils/ClientUtil.js';
|
|
|
9
11
|
import ExtensionHandler from '../handlers/ExtensionHandler.js';
|
|
10
12
|
import deploy from '../functions/deploy.js';
|
|
11
13
|
export default class XernerxClient extends Client {
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
14
|
+
constructor(discordOptions, xernerxOptions, config) {
|
|
15
|
+
super(discordOptions);
|
|
16
|
+
this.settings = z
|
|
17
|
+
.object({
|
|
18
|
+
local: z.string(),
|
|
19
|
+
global: z.boolean().default(false).optional(),
|
|
20
|
+
ownerId: z.string().or(z.array(z.string())).default([]),
|
|
21
|
+
permissions: z
|
|
22
|
+
.object({
|
|
23
|
+
client: z.array(z.string()).default([]),
|
|
24
|
+
user: z.array(z.string()).default([]),
|
|
25
|
+
dm: z.boolean().default(false),
|
|
26
|
+
})
|
|
27
|
+
.optional(),
|
|
28
|
+
ignore: z
|
|
29
|
+
.object({
|
|
30
|
+
owner: z.boolean().default(false),
|
|
31
|
+
users: z.array(z.string()).default([]),
|
|
32
|
+
channels: z.array(z.string()).default([]),
|
|
33
|
+
guilds: z.array(z.string()).default([]),
|
|
34
|
+
})
|
|
35
|
+
.optional(),
|
|
36
|
+
log: z
|
|
37
|
+
.object({
|
|
38
|
+
ready: z.boolean().default(false),
|
|
39
|
+
info: z.boolean().default(false),
|
|
40
|
+
error: z.boolean().default(false),
|
|
41
|
+
table: z.array(z.string()).or(z.null()).default(null),
|
|
42
|
+
})
|
|
43
|
+
.optional(),
|
|
44
|
+
cooldown: z
|
|
45
|
+
.object({
|
|
46
|
+
command: z.number().default(0),
|
|
47
|
+
cache: z.number().default(0),
|
|
48
|
+
})
|
|
49
|
+
.optional(),
|
|
50
|
+
})
|
|
51
|
+
.parse(xernerxOptions);
|
|
52
|
+
this.config = config || null;
|
|
53
|
+
this.commands = {
|
|
54
|
+
message: new Collection(),
|
|
55
|
+
slash: new Collection(),
|
|
56
|
+
context: new Collection(),
|
|
57
|
+
};
|
|
58
|
+
this.events = new Collection();
|
|
59
|
+
this.inhibitors = new Collection();
|
|
60
|
+
this.modules = {
|
|
61
|
+
options: {},
|
|
62
|
+
commandHandler: new CommandHandler(this),
|
|
63
|
+
eventHandler: new EventHandler(this),
|
|
64
|
+
inhibitorHandler: new InhibitorHandler(this),
|
|
65
|
+
webhookHandler: new WebhookHandler(this),
|
|
66
|
+
extensionHandler: new ExtensionHandler(this),
|
|
67
|
+
};
|
|
68
|
+
this.util = new ClientUtil(this);
|
|
69
|
+
this.stats = {
|
|
70
|
+
guildCount: this.guilds.cache.size,
|
|
71
|
+
userCount: 0,
|
|
72
|
+
shardId: 0,
|
|
73
|
+
shardCount: 1,
|
|
74
|
+
};
|
|
75
|
+
this.cache = {
|
|
76
|
+
messages: new Collection(),
|
|
77
|
+
cooldowns: new Collection(),
|
|
78
|
+
};
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
async connect(token) {
|
|
82
|
+
const login = this.login(token);
|
|
83
|
+
deploy(this);
|
|
84
|
+
new XernerxLog(this).ready();
|
|
85
|
+
return login;
|
|
86
|
+
}
|
|
85
87
|
}
|
|
86
88
|
//# sourceMappingURL=XernerxClient.js.map
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
1
3
|
import { ShardingManager, ShardingManagerOptions, ClientUser } from 'discord.js';
|
|
2
4
|
interface XernerxOptions {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
log?: {
|
|
6
|
+
info?: boolean;
|
|
7
|
+
};
|
|
6
8
|
}
|
|
7
9
|
export default class XernerxShardClient extends ShardingManager {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
readonly stats: {
|
|
11
|
+
guildCount: number;
|
|
12
|
+
userCount: number;
|
|
13
|
+
shardCount: number;
|
|
14
|
+
};
|
|
15
|
+
user: ClientUser | null;
|
|
16
|
+
constructor(file: string, discordOptions: ShardingManagerOptions, xernerxOptions?: XernerxOptions);
|
|
15
17
|
}
|
|
16
18
|
export {};
|
|
17
19
|
//# sourceMappingURL=XernerxShardClient.d.ts.map
|