xernerx 4.4.18 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/ContextCommandBuilder.d.ts +31 -23
- 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 +11 -2
- package/dist/build/InhibitorBuilder.js +2 -2
- package/dist/build/MessageCommandBuilder.d.ts +26 -20
- package/dist/build/MessageCommandBuilder.js +34 -34
- package/dist/build/SlashCommandBuilder.d.ts +39 -25
- package/dist/build/SlashCommandBuilder.js +48 -48
- package/dist/build/XernerxContextCommand.d.ts +51 -0
- package/dist/build/XernerxContextCommand.d.ts.map +1 -0
- package/dist/build/XernerxContextCommand.js +68 -0
- package/dist/build/XernerxContextCommand.js.map +1 -0
- package/dist/build/XernerxEvent.d.ts +25 -0
- package/dist/build/XernerxEvent.d.ts.map +1 -0
- package/dist/build/XernerxEvent.js +29 -0
- package/dist/build/XernerxEvent.js.map +1 -0
- package/dist/build/XernerxInhibitor.d.ts +29 -0
- package/dist/build/XernerxInhibitor.d.ts.map +1 -0
- package/dist/build/XernerxInhibitor.js +21 -0
- package/dist/build/XernerxInhibitor.js.map +1 -0
- package/dist/build/XernerxMessageCommand.d.ts +48 -0
- package/dist/build/XernerxMessageCommand.d.ts.map +1 -0
- package/dist/build/XernerxMessageCommand.js +61 -0
- package/dist/build/XernerxMessageCommand.js.map +1 -0
- package/dist/build/XernerxSlashCommand.d.ts +62 -0
- package/dist/build/XernerxSlashCommand.d.ts.map +1 -0
- package/dist/build/XernerxSlashCommand.js +114 -0
- package/dist/build/XernerxSlashCommand.js.map +1 -0
- package/dist/client/XernerxClient.d.ts +37 -29
- package/dist/client/XernerxClient.d.ts.map +1 -1
- package/dist/client/XernerxClient.js +33 -33
- package/dist/client/XernerxClient.js.map +1 -1
- package/dist/client/XernerxShardClient.d.ts +1 -1
- package/dist/client/XernerxShardClient.js +15 -13
- 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 +15 -20
- package/dist/functions/deploy.js.map +1 -1
- package/dist/functions/isOwner.d.ts +2 -2
- package/dist/functions/isOwner.d.ts.map +1 -1
- package/dist/functions/isOwner.js +2 -4
- package/dist/functions/isOwner.js.map +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 +2 -3
- package/dist/functions/load.js.map +1 -1
- package/dist/functions/reload.d.ts +1 -1
- package/dist/functions/reload.js +9 -12
- package/dist/functions/sendWebhook.d.ts +1 -1
- package/dist/functions/sendWebhook.js +2 -3
- package/dist/functions/setPresence.d.ts +2 -2
- package/dist/functions/setPresence.js +12 -11
- package/dist/functions/xernerxUser.d.ts +1 -1
- package/dist/functions/xernerxUser.d.ts.map +1 -1
- package/dist/functions/xernerxUser.js +9 -5
- package/dist/functions/xernerxUser.js.map +1 -1
- package/dist/handlers/CommandHandler.d.ts +1 -1
- package/dist/handlers/CommandHandler.js +85 -108
- 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 +3 -5
- package/dist/handlers/Handler.d.ts +5 -5
- package/dist/handlers/Handler.d.ts.map +1 -1
- package/dist/handlers/Handler.js +6 -16
- package/dist/handlers/Handler.js.map +1 -1
- package/dist/handlers/InhibitorHandler.d.ts +1 -1
- package/dist/handlers/InhibitorHandler.js +3 -3
- package/dist/handlers/WebhookHandler.d.ts +2 -4
- package/dist/handlers/WebhookHandler.js +9 -6
- package/dist/handlers/WebhookHandler.js.map +1 -1
- package/dist/main.d.ts +35 -28
- package/dist/main.js +35 -28
- package/dist/main.js.map +1 -1
- package/dist/models/Arguments.d.ts +8 -5
- package/dist/models/Arguments.js +48 -63
- package/dist/models/Arguments.js.map +1 -1
- 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 +7 -2
- package/dist/types/extenders.d.ts +5 -9
- package/dist/types/extenders.js +1 -1
- package/dist/types/interfaces.d.ts +17 -14
- package/dist/types/interfaces.d.ts.map +1 -1
- package/dist/types/interfaces.js +1 -1
- package/dist/types/interfaces.js.map +1 -1
- package/dist/types/types.d.ts +180 -8
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +1 -1
- package/dist/types/types.js.map +1 -1
- package/dist/utils/ClientUtil.d.ts +5 -5
- package/dist/utils/ClientUtil.d.ts.map +1 -1
- package/dist/utils/ClientUtil.js +8 -14
- package/dist/utils/ClientUtil.js.map +1 -1
- package/dist/utils/InteractionUtil.d.ts +2 -3
- package/dist/utils/InteractionUtil.d.ts.map +1 -1
- package/dist/utils/InteractionUtil.js +1 -5
- package/dist/utils/InteractionUtil.js.map +1 -1
- package/dist/utils/MessageUtil.d.ts +2 -3
- package/dist/utils/MessageUtil.d.ts.map +1 -1
- package/dist/utils/MessageUtil.js +5 -13
- package/dist/utils/MessageUtil.js.map +1 -1
- package/dist/utils/Util.d.ts +3 -2
- package/dist/utils/Util.d.ts.map +1 -1
- package/dist/utils/Util.js +4 -1
- package/dist/utils/Util.js.map +1 -1
- package/dist/validators/commandValidation.d.ts +8 -5
- package/dist/validators/commandValidation.js +19 -29
- package/dist/validators/commandValidation.js.map +1 -1
- package/dist/validators/inhibitorValidations.d.ts +20 -4
- package/dist/validators/inhibitorValidations.js +2 -2
- package/dist/validators/inhibitorValidations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,43 +1,51 @@
|
|
|
1
1
|
import { Client, ClientOptions, Collection } from 'discord.js';
|
|
2
2
|
import { XernerxOptions, ModuleOptions, XernerxCommands, XernerxCache } from '../types/interfaces.js';
|
|
3
3
|
import ClientUtil from '../utils/ClientUtil.js';
|
|
4
|
-
import {
|
|
5
|
-
export default class XernerxClient extends Client {
|
|
4
|
+
import { XernerxInhibitor, XernerxEvent } from '../main.js';
|
|
5
|
+
export default class XernerxClient<T = unknown> extends Client {
|
|
6
6
|
readonly settings: {
|
|
7
7
|
ownerId: (string | string[]) & (string | string[] | undefined);
|
|
8
|
-
local
|
|
8
|
+
local: string;
|
|
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
|
-
|
|
10
|
+
permissions?:
|
|
11
|
+
| {
|
|
12
|
+
client: string[];
|
|
13
|
+
user: string[];
|
|
14
|
+
dm: boolean;
|
|
15
|
+
}
|
|
16
|
+
| undefined;
|
|
17
|
+
ignore?:
|
|
18
|
+
| {
|
|
19
|
+
owner: boolean;
|
|
20
|
+
users: string[];
|
|
21
|
+
channels: string[];
|
|
22
|
+
guilds: string[];
|
|
23
|
+
}
|
|
24
|
+
| undefined;
|
|
25
|
+
log?:
|
|
26
|
+
| {
|
|
27
|
+
ready: boolean;
|
|
28
|
+
error: boolean;
|
|
29
|
+
info: boolean;
|
|
30
|
+
table: string[] | null;
|
|
31
|
+
}
|
|
32
|
+
| undefined;
|
|
33
|
+
cooldown?:
|
|
34
|
+
| {
|
|
35
|
+
command: number;
|
|
36
|
+
cache: number;
|
|
37
|
+
}
|
|
38
|
+
| undefined;
|
|
31
39
|
};
|
|
32
|
-
readonly config:
|
|
40
|
+
readonly config: NonNullable<T> | null;
|
|
33
41
|
readonly commands: XernerxCommands;
|
|
34
|
-
readonly events: Collection<string,
|
|
35
|
-
readonly inhibitors: Collection<string,
|
|
42
|
+
readonly events: Collection<string, XernerxEvent>;
|
|
43
|
+
readonly inhibitors: Collection<string, XernerxInhibitor>;
|
|
36
44
|
readonly modules: ModuleOptions;
|
|
37
45
|
readonly util: ClientUtil;
|
|
38
46
|
readonly stats: Record<string, number>;
|
|
39
47
|
readonly cache: XernerxCache;
|
|
40
|
-
constructor(discordOptions: ClientOptions, xernerxOptions: XernerxOptions, config?:
|
|
48
|
+
constructor(discordOptions: ClientOptions, xernerxOptions: XernerxOptions, config?: T);
|
|
41
49
|
connect(token: string): void;
|
|
42
50
|
}
|
|
43
|
-
//# sourceMappingURL=XernerxClient.d.ts.map
|
|
51
|
+
//# sourceMappingURL=XernerxClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XernerxClient.d.ts","sourceRoot":"","sources":["../../src/client/XernerxClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQ/D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtG,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI5D,MAAM,CAAC,OAAO,OAAO,
|
|
1
|
+
{"version":3,"file":"XernerxClient.d.ts","sourceRoot":"","sources":["../../src/client/XernerxClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQ/D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtG,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI5D,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,MAAM;IAC1D,SAAwB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;MAAC;IACjC,SAAwB,MAAM,wBAAC;IAC/B,SAAwB,QAAQ,EAAE,eAAe,CAAC;IAClD,SAAwB,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACjE,SAAwB,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACzE,SAAwB,OAAO,EAAE,aAAa,CAAC;IAC/C,SAAwB,IAAI,EAAE,UAAU,CAAC;IACzC,SAAwB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,SAAwB,KAAK,EAAE,YAAY,CAAC;gBAEzB,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC;IA8ErF,OAAO,CAAC,KAAK,EAAE,MAAM;CAO/B"}
|
|
@@ -13,39 +13,39 @@ export default class XernerxClient extends Client {
|
|
|
13
13
|
super(discordOptions);
|
|
14
14
|
this.settings = z
|
|
15
15
|
.object({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
local: z.string(),
|
|
17
|
+
global: z.boolean().default(false).optional(),
|
|
18
|
+
ownerId: z.string().or(z.array(z.string())).default([]),
|
|
19
|
+
permissions: z
|
|
20
|
+
.object({
|
|
21
|
+
client: z.array(z.string()).default([]),
|
|
22
|
+
user: z.array(z.string()).default([]),
|
|
23
|
+
dm: z.boolean().default(false),
|
|
24
|
+
})
|
|
25
|
+
.optional(),
|
|
26
|
+
ignore: z
|
|
27
|
+
.object({
|
|
28
|
+
owner: z.boolean().default(false),
|
|
29
|
+
users: z.array(z.string()).default([]),
|
|
30
|
+
channels: z.array(z.string()).default([]),
|
|
31
|
+
guilds: z.array(z.string()).default([]),
|
|
32
|
+
})
|
|
33
|
+
.optional(),
|
|
34
|
+
log: z
|
|
35
|
+
.object({
|
|
36
|
+
ready: z.boolean().default(false),
|
|
37
|
+
info: z.boolean().default(false),
|
|
38
|
+
error: z.boolean().default(false),
|
|
39
|
+
table: z.array(z.string()).or(z.null()).default(null),
|
|
40
|
+
})
|
|
41
|
+
.optional(),
|
|
42
|
+
cooldown: z
|
|
43
|
+
.object({
|
|
44
|
+
command: z.number().default(0),
|
|
45
|
+
cache: z.number().default(0),
|
|
46
|
+
})
|
|
47
|
+
.optional(),
|
|
24
48
|
})
|
|
25
|
-
.optional(),
|
|
26
|
-
ignore: z
|
|
27
|
-
.object({
|
|
28
|
-
owner: z.boolean().default(false),
|
|
29
|
-
users: z.array(z.string()).default([]),
|
|
30
|
-
channels: z.array(z.string()).default([]),
|
|
31
|
-
guilds: z.array(z.string()).default([]),
|
|
32
|
-
})
|
|
33
|
-
.optional(),
|
|
34
|
-
log: z
|
|
35
|
-
.object({
|
|
36
|
-
ready: z.boolean().default(false),
|
|
37
|
-
info: z.boolean().default(false),
|
|
38
|
-
error: z.boolean().default(false),
|
|
39
|
-
table: z.array(z.string()).or(z.null()).default(null),
|
|
40
|
-
})
|
|
41
|
-
.optional(),
|
|
42
|
-
cooldown: z
|
|
43
|
-
.object({
|
|
44
|
-
command: z.number().default(0),
|
|
45
|
-
cache: z.number().default(0),
|
|
46
|
-
})
|
|
47
|
-
.optional(),
|
|
48
|
-
})
|
|
49
49
|
.parse(xernerxOptions);
|
|
50
50
|
this.config = config || null;
|
|
51
51
|
this.commands = {
|
|
@@ -82,4 +82,4 @@ export default class XernerxClient extends Client {
|
|
|
82
82
|
new XernerxLog(this).ready();
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
//# sourceMappingURL=XernerxClient.js.map
|
|
85
|
+
//# sourceMappingURL=XernerxClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XernerxClient.js","sourceRoot":"","sources":["../../src/client/XernerxClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,UAAU,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,
|
|
1
|
+
{"version":3,"file":"XernerxClient.js","sourceRoot":"","sources":["../../src/client/XernerxClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,UAAU,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,aAA2B,SAAQ,MAAM;IAW1D,YAAmB,cAA6B,EAAE,cAA8B,EAAE,MAAU;QACxF,KAAK,CAAC,cAAc,CAAC,CAAC;QAEtB,IAAI,CAAC,QAAQ,GAAG,CAAC;aACZ,MAAM,CA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AAC,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjC,IAAI,CAAC,KAAK,GAAG;YACT,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI;YAClC,SAAS,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC;YACV,UAAU,EAAE,CAAC;SAChB,CAAC;QAEF,IAAI,CAAC,KAAK,GAAG;YACT,QAAQ,EAAE,IAAI,UAAU,EAAE;YAC1B,SAAS,EAAE,IAAI,UAAU,EAAE;SAC9B,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,OAAO,CAAC,KAAa;QACxB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAElB,MAAM,CAAC,IAAI,CAAC,CAAC;QAEb,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;CACJ","sourcesContent":["import { Client, ClientOptions, Collection } from 'discord.js';\nimport { z } from 'zod';\n\nimport CommandHandler from '../handlers/CommandHandler.js';\nimport EventHandler from '../handlers/EventHandler.js';\nimport InhibitorHandler from '../handlers/InhibitorHandler.js';\nimport WebhookHandler from '../handlers/WebhookHandler.js';\nimport XernerxLog from '../tools/XernerxLog.js';\nimport { XernerxOptions, ModuleOptions, XernerxCommands, XernerxCache } from '../types/interfaces.js';\nimport ClientUtil from '../utils/ClientUtil.js';\nimport { XernerxInhibitor, XernerxEvent } from '../main.js';\nimport ExtensionHandler from '../handlers/ExtensionHandler.js';\nimport deploy from '../functions/deploy.js';\n\nexport default class XernerxClient<T = unknown> extends Client {\n public declare readonly settings;\n public declare readonly config;\n public declare readonly commands: XernerxCommands;\n public declare readonly events: Collection<string, XernerxEvent>;\n public declare readonly inhibitors: Collection<string, XernerxInhibitor>;\n public declare readonly modules: ModuleOptions;\n public declare readonly util: ClientUtil;\n public declare readonly stats: Record<string, number>;\n public declare readonly cache: XernerxCache;\n\n public constructor(discordOptions: ClientOptions, xernerxOptions: XernerxOptions, config?: T) {\n super(discordOptions);\n\n this.settings = z\n .object({\n local: z.string(),\n global: z.boolean().default(false).optional(),\n ownerId: z.string().or(z.array(z.string())).default([]),\n permissions: z\n .object({\n client: z.array(z.string()).default([]),\n user: z.array(z.string()).default([]),\n dm: z.boolean().default(false),\n })\n .optional(),\n ignore: z\n .object({\n owner: z.boolean().default(false),\n users: z.array(z.string()).default([]),\n channels: z.array(z.string()).default([]),\n guilds: z.array(z.string()).default([]),\n })\n .optional(),\n log: z\n .object({\n ready: z.boolean().default(false),\n info: z.boolean().default(false),\n error: z.boolean().default(false),\n table: z.array(z.string()).or(z.null()).default(null),\n })\n .optional(),\n cooldown: z\n .object({\n command: z.number().default(0),\n cache: z.number().default(0),\n })\n .optional(),\n })\n .parse(xernerxOptions);\n\n this.config = config || null;\n\n this.commands = {\n message: new Collection(),\n slash: new Collection(),\n context: new Collection(),\n };\n\n this.events = new Collection();\n\n this.inhibitors = new Collection();\n\n this.modules = {\n options: {},\n commandHandler: new CommandHandler(this),\n eventHandler: new EventHandler(this),\n inhibitorHandler: new InhibitorHandler(this),\n webhookHandler: new WebhookHandler(this),\n extensionHandler: new ExtensionHandler(this),\n } as const;\n\n this.util = new ClientUtil(this);\n\n this.stats = {\n guildCount: this.guilds.cache.size,\n userCount: 0,\n shardId: 0,\n shardCount: 1,\n };\n\n this.cache = {\n messages: new Collection(),\n cooldowns: new Collection(),\n };\n\n return this;\n }\n\n public connect(token: string) {\n this.login(token);\n\n deploy(this);\n\n new XernerxLog(this).ready();\n }\n}\n"]}
|
|
@@ -14,4 +14,4 @@ export default class XernerxShardClient extends ShardingManager {
|
|
|
14
14
|
constructor(file: string, discordOptions: ShardingManagerOptions, xernerxOptions?: XernerxOptions);
|
|
15
15
|
}
|
|
16
16
|
export {};
|
|
17
|
-
//# sourceMappingURL=XernerxShardClient.d.ts.map
|
|
17
|
+
//# sourceMappingURL=XernerxShardClient.d.ts.map
|
|
@@ -8,25 +8,27 @@ export default class XernerxShardClient extends ShardingManager {
|
|
|
8
8
|
this.on('shardCreate', async (shard) => {
|
|
9
9
|
shard
|
|
10
10
|
.on('ready', async () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const guilds = await shard.fetchClientValue('guilds.cache');
|
|
12
|
+
const guildCount = guilds.length;
|
|
13
|
+
const userCount = guilds.map((guild) => guild.memberCount).length ? guilds.map((guild) => guild.memberCount).reduce((a, b) => (a += b)) : 0;
|
|
14
|
+
this.stats.guildCount += Number(guildCount);
|
|
15
|
+
this.stats.userCount += Number(userCount);
|
|
16
|
+
this.stats.shardCount++;
|
|
17
|
+
this.user = await shard.fetchClientValue('user');
|
|
18
|
+
await new XernerxLog({ settings: xernerxOptions }).info(`Launched shard ${shard.id} for ${this.user?.tag}!`);
|
|
19
|
+
})
|
|
20
20
|
.on('error', (error) => {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
new XernerxLog({ settings: xernerxOptions }).info(`An error occurred in ${shard.id} for ${this.user?.tag}! ${error}`);
|
|
22
|
+
});
|
|
23
23
|
});
|
|
24
24
|
const spawn = this.spawn();
|
|
25
25
|
spawn.then(async (shards) => {
|
|
26
26
|
const collector = setInterval(() => {
|
|
27
27
|
const index = shards.size - 1;
|
|
28
28
|
if (shards.get(index)?.ready) {
|
|
29
|
-
new XernerxLog({ settings: xernerxOptions }).info(
|
|
29
|
+
new XernerxLog({ settings: xernerxOptions }).info(
|
|
30
|
+
`Launched all ${this.stats.shardCount} shards for ${this.user?.tag}, watching ${this.stats.guildCount} guilds, and ${this.stats.userCount} users!`
|
|
31
|
+
);
|
|
30
32
|
clearInterval(collector);
|
|
31
33
|
}
|
|
32
34
|
}, 1000);
|
|
@@ -37,4 +39,4 @@ export default class XernerxShardClient extends ShardingManager {
|
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
//# sourceMappingURL=XernerxShardClient.js.map
|
|
42
|
+
//# sourceMappingURL=XernerxShardClient.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default function delay(time: number): Promise<unknown>;
|
|
2
|
-
//# sourceMappingURL=delay.d.ts.map
|
|
2
|
+
//# sourceMappingURL=delay.d.ts.map
|
package/dist/functions/delay.js
CHANGED
package/dist/functions/deploy.js
CHANGED
|
@@ -4,37 +4,32 @@ import XernerxError from '../tools/XernerxError.js';
|
|
|
4
4
|
const commands = [];
|
|
5
5
|
export default function deploy(client) {
|
|
6
6
|
client.prependOnceListener('ready', (client) => {
|
|
7
|
-
if (client.commands.slash.size)
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
client.commands.context.map((command) => commands.push(command.data.toJSON()));
|
|
11
|
-
if (commands.length <= 0)
|
|
12
|
-
return;
|
|
7
|
+
if (client.commands.slash.size) client.commands.slash.map((command) => commands.push(command.data.toJSON()));
|
|
8
|
+
if (client.commands.context.size) client.commands.context.map((command) => commands.push(command.data.toJSON()));
|
|
9
|
+
if (commands.length <= 0) return;
|
|
13
10
|
try {
|
|
14
11
|
if (client.settings.global) {
|
|
15
12
|
put(client, client.settings.global, commands);
|
|
16
13
|
put(client, !client.settings.global, []);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
14
|
+
} else {
|
|
19
15
|
put(client, !client.settings.global, commands);
|
|
20
16
|
put(client, client.settings.global, []);
|
|
21
17
|
}
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
18
|
+
} catch (error) {
|
|
24
19
|
new XernerxLog(client).error(`An error occurred while deploying the interaction commands!`, error);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
} finally {
|
|
21
|
+
new XernerxLog(client).info(
|
|
22
|
+
`Deployed ${[client.commands.message.size, client.commands.slash.size, client.commands.context.size].reduce((a, b) => (a += b))} Commands ${
|
|
23
|
+
client.settings.global ? 'globally' : `locally in ${client.guilds.cache.get(client.settings.local).name}`
|
|
24
|
+
}.`
|
|
25
|
+
);
|
|
28
26
|
}
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
29
|
function put(client, global, body) {
|
|
32
30
|
const rest = new REST({ version: GatewayVersion }).setToken(client.token);
|
|
33
|
-
if (!global && !client.settings?.local)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
rest.put(Routes.applicationGuildCommands(client.user?.id, client.settings.local), { body });
|
|
37
|
-
else
|
|
38
|
-
rest.put(Routes.applicationCommands(client.user?.id), { body });
|
|
31
|
+
if (!global && !client.settings?.local) throw new XernerxError(`No guild ID provided as local guild!`);
|
|
32
|
+
if (!global && client.settings?.local) rest.put(Routes.applicationGuildCommands(client.user?.id, client.settings.local), { body });
|
|
33
|
+
else rest.put(Routes.applicationCommands(client.user?.id), { body });
|
|
39
34
|
}
|
|
40
|
-
//# sourceMappingURL=deploy.js.map
|
|
35
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/functions/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAK1D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,QAAQ,GAA6D,EAAE,CAAC;AAE9E,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAqB;IAChD,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE;QAC3C,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAoD,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC1J,IAAI,MAAM,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AAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAC3G,GAAG,CACN,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,GAAG,CAAC,MAAqB,EAAE,MAAe,EAAE,IAAmB;IACpE,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAe,CAAC,CAAC;IAEpF,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK;QAAE,MAAM,IAAI,YAAY,CAAC,sCAAsC,CAAC,CAAC;IAEvG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,KAAK;QAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;;QACxI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAY,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import { GatewayVersion, REST, Routes } from 'discord.js';\n\nimport ContextCommandBuilder from '../build/
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/functions/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAK1D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,QAAQ,GAA6D,EAAE,CAAC;AAE9E,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAqB;IAChD,MAAM,CAA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IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAC3H,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAC3G,GAAG,CACN,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,GAAG,CAAC,MAAqB,EAAE,MAAe,EAAE,IAAmB;IACpE,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAe,CAAC,CAAC;IAEpF,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK;QAAE,MAAM,IAAI,YAAY,CAAC,sCAAsC,CAAC,CAAC;IAEvG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,KAAK;QAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;;QACxI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAY,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import { GatewayVersion, REST, Routes } from 'discord.js';\n\nimport ContextCommandBuilder from '../build/XernerxContextCommand.js';\nimport SlashCommandBuilder from '../build/XernerxSlashCommand.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport XernerxLog from '../tools/XernerxLog.js';\nimport XernerxError from '../tools/XernerxError.js';\n\nconst commands: Array<SlashCommandBuilder | ContextCommandBuilder | any> = [];\n\nexport default function deploy(client: XernerxClient) {\n client.prependOnceListener('ready', (client) => {\n if (client.commands.slash.size) client.commands.slash.map((command: SlashCommandBuilder | ContextCommandBuilder) => commands.push(command.data.toJSON()));\n if (client.commands.context.size) client.commands.context.map((command: SlashCommandBuilder | ContextCommandBuilder) => commands.push(command.data.toJSON()));\n\n if (commands.length <= 0) return;\n\n try {\n if (client.settings.global) {\n put(client, client.settings.global, commands);\n put(client, !client.settings.global, []);\n } else {\n put(client, !client.settings.global, commands);\n put(client, client.settings.global, []);\n }\n } catch (error) {\n new XernerxLog(client).error(`An error occurred while deploying the interaction commands!`, error);\n } finally {\n new XernerxLog(client).info(\n `Deployed ${[client.commands.message.size, client.commands.slash.size, client.commands.context.size].reduce((a, b) => (a += b))} Commands ${\n client.settings.global ? 'globally' : `locally in ${client.guilds.cache.get(client.settings.local).name}`\n }.`\n );\n }\n });\n}\n\nfunction put(client: XernerxClient, global: boolean, body: Array<object>) {\n const rest = new REST({ version: GatewayVersion }).setToken(client.token as string);\n\n if (!global && !client.settings?.local) throw new XernerxError(`No guild ID provided as local guild!`);\n\n if (!global && client.settings?.local) rest.put(Routes.applicationGuildCommands(client.user?.id as string, client.settings.local), { body });\n else rest.put(Routes.applicationCommands(client.user?.id as string), { body });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import XernerxClient from '../client/XernerxClient.js';
|
|
2
2
|
import { XernerxUser } from '../types/extenders.js';
|
|
3
|
-
export default function isOwner(user: Pick<XernerxUser, 'id'>, client: XernerxClient):
|
|
4
|
-
//# sourceMappingURL=isOwner.d.ts.map
|
|
3
|
+
export default function isOwner(user: Pick<XernerxUser, 'id'>, client: XernerxClient): void;
|
|
4
|
+
//# sourceMappingURL=isOwner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isOwner.d.ts","sourceRoot":"","sources":["../../src/functions/isOwner.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"isOwner.d.ts","sourceRoot":"","sources":["../../src/functions/isOwner.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,aAAa,QAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isOwner.js","sourceRoot":"","sources":["../../src/functions/isOwner.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAA6B,EAAE,MAAqB
|
|
1
|
+
{"version":3,"file":"isOwner.js","sourceRoot":"","sources":["../../src/functions/isOwner.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAA6B,EAAE,MAAqB,IAAG,CAAC","sourcesContent":["import XernerxClient from '../client/XernerxClient.js';\nimport { XernerxUser } from '../types/extenders.js';\n\nexport default function isOwner(user: Pick<XernerxUser, 'id'>, client: XernerxClient) {}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import XernerxClient from '../client/XernerxClient.js';
|
|
2
2
|
import { XernerxUser } from '../types/extenders.js';
|
|
3
3
|
export default function isVoter(user: XernerxUser, client: XernerxClient, token: string, host: 'top.gg'): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=isVoter.d.ts.map
|
|
4
|
+
//# sourceMappingURL=isVoter.d.ts.map
|
package/dist/functions/load.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import XernerxClient from '../client/XernerxClient.js';
|
|
2
2
|
import { FileType } from '../types/types.js';
|
|
3
3
|
export default function load(client: XernerxClient, path: string, type: FileType): Promise<any>;
|
|
4
|
-
//# sourceMappingURL=load.d.ts.map
|
|
4
|
+
//# sourceMappingURL=load.d.ts.map
|
package/dist/functions/load.js
CHANGED
|
@@ -7,8 +7,7 @@ export default async function load(client, path, type) {
|
|
|
7
7
|
file.client = client;
|
|
8
8
|
fileSave(client, file, type);
|
|
9
9
|
return file;
|
|
10
|
-
}
|
|
11
|
-
catch (error) {
|
|
10
|
+
} catch (error) {
|
|
12
11
|
new XernerxLog(client).error(`Couldn't load ${type} ${path.match(/\w*\.js$/gim)?.at(0) || path}`, error);
|
|
13
12
|
}
|
|
14
13
|
}
|
|
@@ -31,4 +30,4 @@ function fileSave(client, file, type) {
|
|
|
31
30
|
break;
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
|
-
//# sourceMappingURL=load.js.map
|
|
33
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/functions/load.ts"],"names":[],"mappings":"AAOA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,MAAqB,EAAE,IAAY,EAAE,IAAc;IAClF,IAAI;QACA,IAAI,IAAI,GAAG,IAAI,CAAC,MAAM,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAE1D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAE7B,OAAO,IAAI,CAAC;KACf;IAAC,OAAO,KAAK,EAAE;QACZ,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,iBAAiB,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;KAC5G;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,MAAqB,EAAE,IAA2G,EAAE,IAAc;IAChK,QAAQ,IAAI,EAAE;QACV,KAAK,gBAAgB;YACjB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAA6B,CAAC,CAAC;YACtE,MAAM;QACV,KAAK,cAAc;YACf,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAA2B,CAAC,CAAC;YAClE,MAAM;QACV,KAAK,gBAAgB;YACjB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAA6B,CAAC,CAAC;YACtE,MAAM;QACV,KAAK,WAAW;YACZ,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAwB,CAAC,CAAC;YAC3D,MAAM;QACV,KAAK,OAAO;YACR,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAoB,CAAC,CAAC;YACnD,MAAM;KACb;AACL,CAAC","sourcesContent":["import InhibitorBuilder from '../build/
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/functions/load.ts"],"names":[],"mappings":"AAOA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,MAAqB,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AAI,CAAC,IAAI,EAAE,IAAoB,CAAC,CAAC;YACnD,MAAM;KACb;AACL,CAAC","sourcesContent":["import InhibitorBuilder from '../build/XernerxInhibitor.js';\nimport SlashCommandBuilder from '../build/XernerxSlashCommand.js';\nimport ContextCommandBuilder from '../build/XernerxContextCommand.js';\nimport MessageCommandBuilder from '../build/XernerxMessageCommand.js';\nimport EventBuilder from '../build/XernerxEvent.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { FileType } from '../types/types.js';\nimport XernerxLog from '../tools/XernerxLog.js';\n\nexport default async function load(client: XernerxClient, path: string, type: FileType) {\n try {\n let file = new (await import(`file://${path}`)).default();\n\n file.fileType = type;\n\n file.filePath = path;\n\n file.client = client;\n\n fileSave(client, file, type);\n\n return file;\n } catch (error) {\n new XernerxLog(client).error(`Couldn't load ${type} ${path.match(/\\w*\\.js$/gim)?.at(0) || path}`, error);\n }\n}\n\nfunction fileSave(client: XernerxClient, file: MessageCommandBuilder | SlashCommandBuilder | ContextCommandBuilder | EventBuilder | InhibitorBuilder, type: FileType) {\n switch (type) {\n case 'MessageCommand':\n client.commands.message.set(file.name, file as MessageCommandBuilder);\n break;\n case 'SlashCommand':\n client.commands.slash.set(file.name, file as SlashCommandBuilder);\n break;\n case 'ContextCommand':\n client.commands.context.set(file.name, file as ContextCommandBuilder);\n break;\n case 'Inhibitor':\n client.inhibitors.set(file.name, file as InhibitorBuilder);\n break;\n case 'Event':\n client.events.set(file.name, file as EventBuilder);\n break;\n }\n}\n"]}
|
package/dist/functions/reload.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var FileTypes;
|
|
2
2
|
(function (FileTypes) {
|
|
3
|
-
FileTypes[
|
|
4
|
-
FileTypes[
|
|
5
|
-
FileTypes[
|
|
6
|
-
FileTypes[
|
|
7
|
-
FileTypes[
|
|
3
|
+
FileTypes['message'] = 'MessageCommand';
|
|
4
|
+
FileTypes['slash'] = 'SlashCommand';
|
|
5
|
+
FileTypes['context'] = 'ContextCommand';
|
|
6
|
+
FileTypes['event'] = 'Event';
|
|
7
|
+
FileTypes['inhibitor'] = 'Inhibitor';
|
|
8
8
|
})(FileTypes || (FileTypes = {}));
|
|
9
9
|
export default function reload(client, type) {
|
|
10
10
|
const files = [];
|
|
@@ -31,13 +31,10 @@ export default function reload(client, type) {
|
|
|
31
31
|
filedata.fileType = FileTypes[type];
|
|
32
32
|
filedata.filePath = file;
|
|
33
33
|
filedata.client = client;
|
|
34
|
-
if (type === 'message' || type === 'slash' || type === 'context')
|
|
35
|
-
|
|
36
|
-
if (type === '
|
|
37
|
-
client.events.set(filedata.name, filedata);
|
|
38
|
-
if (type === 'inhibitor')
|
|
39
|
-
client.inhibitors.set(filedata.name, filedata);
|
|
34
|
+
if (type === 'message' || type === 'slash' || type === 'context') client.commands[type].set(filedata.name, filedata);
|
|
35
|
+
if (type === 'event') client.events.set(filedata.name, filedata);
|
|
36
|
+
if (type === 'inhibitor') client.inhibitors.set(filedata.name, filedata);
|
|
40
37
|
return filedata;
|
|
41
38
|
});
|
|
42
39
|
}
|
|
43
|
-
//# sourceMappingURL=reload.js.map
|
|
40
|
+
//# sourceMappingURL=reload.js.map
|
|
@@ -6,9 +6,8 @@ export default async function sendWebhook(url, body) {
|
|
|
6
6
|
},
|
|
7
7
|
body: JSON.stringify(body),
|
|
8
8
|
});
|
|
9
|
-
if (response.status === 204)
|
|
10
|
-
return true;
|
|
9
|
+
if (response.status === 204) return true;
|
|
11
10
|
const data = await response.json();
|
|
12
11
|
return data;
|
|
13
12
|
}
|
|
14
|
-
//# sourceMappingURL=sendWebhook.js.map
|
|
13
|
+
//# sourceMappingURL=sendWebhook.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import XernerxClient from '../main.js';
|
|
2
2
|
import { PresenceOptions } from '../types/interfaces.js';
|
|
3
|
-
export default function setPresence(client: XernerxClient, options: PresenceOptions): import(
|
|
4
|
-
//# sourceMappingURL=setPresence.d.ts.map
|
|
3
|
+
export default function setPresence(client: XernerxClient, options: PresenceOptions): import('discord.js').ClientPresence | undefined;
|
|
4
|
+
//# sourceMappingURL=setPresence.d.ts.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
export default function setPresence(client, options) {
|
|
2
|
-
const presence = () =>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
const presence = () =>
|
|
3
|
+
client.user?.setPresence({
|
|
4
|
+
activities: [
|
|
5
|
+
{
|
|
6
|
+
name: options.text,
|
|
7
|
+
type: options.type,
|
|
8
|
+
url: options.url,
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
status: options.status,
|
|
12
|
+
});
|
|
12
13
|
let response = presence();
|
|
13
14
|
if (options.interval)
|
|
14
15
|
setInterval(() => {
|
|
@@ -16,4 +17,4 @@ export default function setPresence(client, options) {
|
|
|
16
17
|
}, options.interval);
|
|
17
18
|
return response;
|
|
18
19
|
}
|
|
19
|
-
//# sourceMappingURL=setPresence.js.map
|
|
20
|
+
//# sourceMappingURL=setPresence.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import XernerxClient from '../client/XernerxClient.js';
|
|
2
2
|
import { XernerxMessage, XernerxSlashInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
3
3
|
export declare function xernerxUser(event: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction, client: XernerxClient): Promise<XernerxUser>;
|
|
4
|
-
//# sourceMappingURL=xernerxUser.d.ts.map
|
|
4
|
+
//# sourceMappingURL=xernerxUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xernerxUser.d.ts","sourceRoot":"","sources":["../../src/functions/xernerxUser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xernerxUser.d.ts","sourceRoot":"","sources":["../../src/functions/xernerxUser.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE5H,wBAAsB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,uBAAuB,GAAG,6BAA6B,GAAG,6BAA6B,EAAE,MAAM,EAAE,aAAa,wBAUvK"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import isOwner from './isOwner.js';
|
|
2
1
|
export async function xernerxUser(event, client) {
|
|
3
2
|
const author = event.author || event.user;
|
|
4
|
-
const user =
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const user = {
|
|
4
|
+
...author,
|
|
5
|
+
owner: isOwner(client, author),
|
|
6
|
+
voted: (await client.util.hasVoted(author.id)) || null,
|
|
7
|
+
};
|
|
7
8
|
return user;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
function isOwner(client, user) {
|
|
11
|
+
return client.settings.ownerId.includes(user.id);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=xernerxUser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xernerxUser.js","sourceRoot":"","sources":["../../src/functions/xernerxUser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xernerxUser.js","sourceRoot":"","sources":["../../src/functions/xernerxUser.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAA+G,EAAE,MAAqB;IACpK,MAAM,MAAM,GAAU,KAAwB,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC;IAEpE,MAAM,IAAI,GAAG;QACT,GAAG,MAAM;QACT,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC;QAC9B,KAAK,EAAE,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI;KACzD,CAAC;IAEF,OAAO,IAAmB,CAAC;AAC/B,CAAC;AAED,SAAS,OAAO,CAAC,MAAqB,EAAE,IAAU;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { User } from 'discord.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxMessage, XernerxSlashInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';\n\nexport async function xernerxUser(event: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction, client: XernerxClient) {\n const author: User = (event as XernerxMessage).author || event.user;\n\n const user = {\n ...author,\n owner: isOwner(client, author),\n voted: (await client.util.hasVoted(author.id)) || null,\n };\n\n return user as XernerxUser;\n}\n\nfunction isOwner(client: XernerxClient, user: User) {\n return client.settings.ownerId.includes(user.id);\n}\n"]}
|