xernerx 4.4.13 → 4.4.15
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 +34 -26
- package/dist/build/ContextCommandBuilder.d.ts.map +1 -1
- package/dist/build/ContextCommandBuilder.js +39 -39
- package/dist/build/ContextCommandBuilder.js.map +1 -1
- package/dist/build/EventBuilder.d.ts +2 -2
- package/dist/build/EventBuilder.d.ts.map +1 -1
- package/dist/build/EventBuilder.js +2 -2
- package/dist/build/EventBuilder.js.map +1 -1
- package/dist/build/InhibitorBuilder.d.ts +13 -4
- package/dist/build/InhibitorBuilder.d.ts.map +1 -1
- package/dist/build/InhibitorBuilder.js +2 -2
- package/dist/build/InhibitorBuilder.js.map +1 -1
- package/dist/build/MessageCommandBuilder.d.ts +29 -23
- package/dist/build/MessageCommandBuilder.d.ts.map +1 -1
- package/dist/build/MessageCommandBuilder.js +34 -34
- package/dist/build/MessageCommandBuilder.js.map +1 -1
- package/dist/build/SlashCommandBuilder.d.ts +42 -28
- package/dist/build/SlashCommandBuilder.d.ts.map +1 -1
- package/dist/build/SlashCommandBuilder.js +48 -48
- package/dist/build/SlashCommandBuilder.js.map +1 -1
- package/dist/client/XernerxClient.d.ts +30 -22
- package/dist/client/XernerxClient.js +33 -33
- package/dist/client/XernerxShardClient.d.ts +1 -1
- package/dist/client/XernerxShardClient.d.ts.map +1 -1
- package/dist/client/XernerxShardClient.js +18 -12
- package/dist/client/XernerxShardClient.js.map +1 -1
- 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 +13 -16
- 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 +2 -3
- 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.js +1 -1
- package/dist/handlers/CommandHandler.d.ts +1 -1
- package/dist/handlers/CommandHandler.js +82 -105
- 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 +1 -1
- package/dist/handlers/Handler.js +6 -16
- 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/main.d.ts +29 -22
- package/dist/main.js +29 -22
- package/dist/models/Arguments.d.ts +6 -3
- package/dist/models/Arguments.d.ts.map +1 -1
- 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 +8 -9
- package/dist/types/extenders.d.ts.map +1 -1
- package/dist/types/extenders.js +1 -1
- package/dist/types/extenders.js.map +1 -1
- package/dist/types/interfaces.d.ts +13 -8
- 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 +179 -7
- 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 +4 -4
- package/dist/utils/ClientUtil.js +8 -14
- package/dist/utils/InteractionUtil.d.ts +4 -3
- package/dist/utils/InteractionUtil.d.ts.map +1 -1
- package/dist/utils/InteractionUtil.js +1 -1
- package/dist/utils/InteractionUtil.js.map +1 -1
- package/dist/utils/MessageUtil.d.ts +2 -2
- package/dist/utils/MessageUtil.js +5 -9
- package/dist/utils/Util.d.ts +1 -1
- package/dist/utils/Util.js +1 -1
- package/dist/validators/commandValidation.d.ts +6 -3
- package/dist/validators/commandValidation.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/validators/inhibitorValidations.js +1 -1
- package/dist/validators/inhibitorValidations.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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([]),
|
|
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({}),
|
|
37
61
|
})
|
|
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,9 +85,11 @@ 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
|
-
|
|
88
|
+
option.setChoices(
|
|
89
|
+
...argument.choices.map((choices) => {
|
|
90
|
+
return { name: Object.keys(choices).at(0), value: Object.values(choices).at(0) };
|
|
91
|
+
})
|
|
92
|
+
);
|
|
91
93
|
option.setAutocomplete(argument.autocomplete || false);
|
|
92
94
|
}
|
|
93
95
|
return option;
|
|
@@ -97,18 +99,16 @@ export default class SlashCommandBuilder {
|
|
|
97
99
|
addSubcommands(method, subcommands) {
|
|
98
100
|
for (const subcommand of subcommands) {
|
|
99
101
|
let sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);
|
|
100
|
-
if (subcommand.args && subcommand?.args?.length > 0)
|
|
101
|
-
this.addArguments(sub, subcommand.args);
|
|
102
|
+
if (subcommand.args && subcommand?.args?.length > 0) this.addArguments(sub, subcommand.args);
|
|
102
103
|
method.addSubcommand(sub);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
addSubcommandGroups(groups) {
|
|
106
107
|
for (const group of groups) {
|
|
107
108
|
let subcommandGroup = new SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);
|
|
108
|
-
if (group.subcommands?.length > 0)
|
|
109
|
-
this.addSubcommands(subcommandGroup, group.subcommands);
|
|
109
|
+
if (group.subcommands?.length > 0) 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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlashCommandBuilder.js","sourceRoot":"","sources":["../../src/build/SlashCommandBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAA4B,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,YAAY,CAAC;AAClI,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAMvD,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAiBpC,YAAY,EAAU,EAAE,OAA4B;QAChD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;QAE9C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,IAAI,IAAI,CAAC,CAAC;QAElE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAE9C,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,wBAAwB,IAAI,IAAI,CAAC,CAAC;QAEhF,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC;QAE3D,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE;YAC3C,IAAI,CAAC,Y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IAAI,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YAE9G,IAAI,UAAU,CAAC,IAAI,IAAI,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YAE7F,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;SAC7B;IACL,CAAC;IAEO,mBAAmB,CAAC,MAAuC;QAC/D,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,IAAI,eAAe,GAAG,IAAI,kCAAkC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAErH,IAAI,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;YAE3F,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;SACjD;IACL,CAAC;CACJ","sourcesContent":["import Discord, { SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from 'discord.js';\nimport { z } from 'zod';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxSlashInteraction } from '../types/extenders.js';\n\nimport { SlashCommandArgumentOptions, SlashCommandGroupOptions, SlashCommandOptions, SlashCommandSubcommandOptions } from '../types/interfaces.js';\nimport { SlashCommandArgumentType, SlashCommandOption, XernerxInteraction } from '../types/types.js';\n\nexport default class SlashCommandBuilder {\n public declare readonly id;\n public declare readonly data;\n public declare readonly name;\n public declare readonly description;\n public declare readonly usage;\n public declare readonly info;\n public declare readonly category;\n public declare readonly cooldown;\n public declare readonly ignore;\n public declare readonly strict;\n public declare readonly permissions;\n public declare readonly defer;\n public declare readonly fileType: 'SlashCommand';\n public declare readonly filePath: string;\n public declare readonly client;\n\n constructor(id: string, options: SlashCommandOptions) {\n this.id = id;\n\n this.data = new Discord.SlashCommandBuilder();\n\n this.data.setName(options.name);\n\n this.data.setNameLocalizations(options.nameLocalizations || null);\n\n this.data.setDescription(options.description);\n\n this.data.setDescriptionLocalizations(options.descriptionLocalizations || null);\n\n this.data.setDMPermission(options.permissions?.dm || null);\n\n if (options.args && options?.args?.length > 0) {\n this.addArguments(this.data, options.args);\n }\n\n if (options.subcommands && options?.subcommands?.length > 0) {\n this.addSubcommands(this.data, options.subcommands);\n }\n\n if (options.groups && options?.groups?.length > 0) {\n this.addSubcommandGroups(options.groups);\n }\n\n options = z\n .object({\n name: z.string(),\n description: z.string(),\n usage: z.string().or(z.null()).default(null),\n info: z.string().or(z.null()).default(null),\n category: z.string().or(z.null()).default(null),\n number: z.number().or(z.null()).default(null),\n channelType: z.array(z.number()).or(z.null()).default(null),\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 .default({}),\n strict: 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 .default({}),\n permissions: z\n .object({\n user: z.array(z.string()).default([]),\n client: z.array(z.string()).default([]),\n dm: z.boolean().default(true),\n })\n .default({}),\n defer: z\n .object({\n reply: z.boolean().default(false),\n ephemeral: z.boolean().default(false),\n fetch: z.boolean().default(false),\n })\n .default({}),\n })\n .parse(options);\n\n this.name = options.name;\n\n this.description = options.description;\n\n this.usage = options.usage;\n\n this.info = options.info;\n\n this.category = options.category;\n\n this.cooldown = options.cooldown;\n\n this.ignore = options.ignore;\n\n this.strict = options.strict;\n\n this.permissions = options.permissions;\n\n this.defer = options.defer;\n\n this.client = XernerxClient;\n }\n\n public async autocomplete<T>(interaction: XernerxInteraction, focused: T, options: T[]): Promise<void | any | T> {}\n\n public async conditions<T>(interaction: XernerxSlashInteraction, { args, subcommand, group }: any): Promise<void | any | T> {}\n\n public async exec<T>(interaction: XernerxSlashInteraction, { args, subcommand, group }: any): Promise<void | any | T> {}\n\n private addArguments(command: Discord.SlashCommandBuilder | SlashCommandSubcommandBuilder, args: Array<SlashCommandArgumentOptions>) {\n for (const argument of args) {\n let slashCommandArgumentType: SlashCommandArgumentType | string = `${argument.type.charAt(0).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;\n\n (command[`add${slashCommandArgumentType as UpperCasedSlashCommandArgumentOptions}Option`] as Function)((option: SlashCommandOption) => {\n option\n .setName(argument.name)\n .setDescription(argument.description)\n .setRequired(argument.required || false);\n\n if (slashCommandArgumentType === 'String') {\n if (argument.choices)\n (option as SlashCommandStringOption).setChoices(\n ...(argument.choices.map((choices) => {\n return { name: Object.keys(choices).at(0), value: Object.values(choices).at(0) };\n }) as Array<any>)\n );\n\n (option as SlashCommandStringOption).setAutocomplete(argument.autocomplete || false);\n }\n\n return option;\n });\n }\n }\n\n private addSubcommands(method: Discord.SlashCommandBuilder | SlashCommandSubcommandGroupBuilder, subcommands: Array<SlashCommandSubcommandOptions>) {\n for (const subcommand of subcommands) {\n let sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);\n\n if (subcommand.args && subcommand?.args?.length > 0) this.addArguments(sub, subcommand.args);\n\n method.addSubcommand(sub);\n }\n }\n\n private addSubcommandGroups(groups: Array<SlashCommandGroupOptions>) {\n for (const group of groups) {\n let subcommandGroup = new SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);\n\n if (group.subcommands?.length > 0) this.addSubcommands(subcommandGroup, group.subcommands);\n\n this.data.addSubcommandGroup(subcommandGroup);\n }\n }\n}\n\ntype UpperCasedSlashCommandArgumentOptions = 'Attachment' | 'Boolean' | 'Channel' | 'Integer' | 'Mentionable' | 'Number' | 'Role' | 'String' | 'User';\n"]}
|
|
1
|
+
{"version":3,"file":"SlashCommandBuilder.js","sourceRoot":"","sources":["../../src/build/SlashComm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AAK,IAAI,MAAM,EAAE;YACxB,IAAI,eAAe,GAAG,IAAI,kCAAkC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAErH,IAAI,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;YAE3F,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;SACjD;IACL,CAAC;CACJ","sourcesContent":["import Discord, { SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from 'discord.js';\nimport { z } from 'zod';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';\n\nimport { SlashCommandArgumentOptions, SlashCommandArguments, SlashCommandGroupOptions, SlashCommandOptions, SlashCommandSubcommandOptions } from '../types/interfaces.js';\nimport { SlashCommandArgumentType, SlashCommandOption, XernerxInteraction } from '../types/types.js';\n\nexport default class SlashCommandBuilder {\n public declare readonly id;\n public declare readonly data;\n public declare readonly name;\n public declare readonly description;\n public declare readonly usage;\n public declare readonly info;\n public declare readonly category;\n public declare readonly cooldown;\n public declare readonly ignore;\n public declare readonly strict;\n public declare readonly permissions;\n public declare readonly defer;\n public declare readonly fileType: 'SlashCommand';\n public declare readonly filePath: string;\n public declare readonly client;\n\n constructor(id: string, options: SlashCommandOptions) {\n this.id = id;\n\n this.data = new Discord.SlashCommandBuilder();\n\n this.data.setName(options.name);\n\n this.data.setNameLocalizations(options.nameLocalizations || null);\n\n this.data.setDescription(options.description);\n\n this.data.setDescriptionLocalizations(options.descriptionLocalizations || null);\n\n this.data.setDMPermission(options.permissions?.dm || null);\n\n if (options.args && options?.args?.length > 0) {\n this.addArguments(this.data, options.args);\n }\n\n if (options.subcommands && options?.subcommands?.length > 0) {\n this.addSubcommands(this.data, options.subcommands);\n }\n\n if (options.groups && options?.groups?.length > 0) {\n this.addSubcommandGroups(options.groups);\n }\n\n options = z\n .object({\n name: z.string(),\n description: z.string(),\n usage: z.string().or(z.null()).default(null),\n info: z.string().or(z.null()).default(null),\n category: z.string().or(z.null()).default(null),\n number: z.number().or(z.null()).default(null),\n channelType: z.array(z.number()).or(z.null()).default(null),\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 .default({}),\n strict: 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 .default({}),\n permissions: z\n .object({\n user: z.array(z.string()).default([]),\n client: z.array(z.string()).default([]),\n dm: z.boolean().default(true),\n })\n .default({}),\n defer: z\n .object({\n reply: z.boolean().default(false),\n ephemeral: z.boolean().default(false),\n fetch: z.boolean().default(false),\n })\n .default({}),\n })\n .parse(options);\n\n this.name = options.name;\n\n this.description = options.description;\n\n this.usage = options.usage;\n\n this.info = options.info;\n\n this.category = options.category;\n\n this.cooldown = options.cooldown;\n\n this.ignore = options.ignore;\n\n this.strict = options.strict;\n\n this.permissions = options.permissions;\n\n this.defer = options.defer;\n\n this.client = XernerxClient;\n }\n\n public async autocomplete<T>(\n interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n focused: T,\n options: T[]\n ): Promise<void | any | T> {}\n\n public async conditions<T>(\n interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n { args, subcommand, group }: SlashCommandArguments\n ): Promise<void | any | T> {}\n\n public async exec<T>(\n interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n { args, subcommand, group }: SlashCommandArguments\n ): Promise<void | any | T> {}\n\n private addArguments(command: Discord.SlashCommandBuilder | SlashCommandSubcommandBuilder, args: Array<SlashCommandArgumentOptions>) {\n for (const argument of args) {\n let slashCommandArgumentType: SlashCommandArgumentType | string = `${argument.type.charAt(0).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;\n\n (command[`add${slashCommandArgumentType as UpperCasedSlashCommandArgumentOptions}Option`] as Function)((option: SlashCommandOption) => {\n option\n .setName(argument.name)\n .setDescription(argument.description)\n .setRequired(argument.required || false);\n\n if (slashCommandArgumentType === 'String') {\n if (argument.choices)\n (option as SlashCommandStringOption).setChoices(\n ...(argument.choices.map((choices) => {\n return { name: Object.keys(choices).at(0), value: Object.values(choices).at(0) };\n }) as Array<any>)\n );\n\n (option as SlashCommandStringOption).setAutocomplete(argument.autocomplete || false);\n }\n\n return option;\n });\n }\n }\n\n private addSubcommands(method: Discord.SlashCommandBuilder | SlashCommandSubcommandGroupBuilder, subcommands: Array<SlashCommandSubcommandOptions>) {\n for (const subcommand of subcommands) {\n let sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);\n\n if (subcommand.args && subcommand?.args?.length > 0) this.addArguments(sub, subcommand.args);\n\n method.addSubcommand(sub);\n }\n }\n\n private addSubcommandGroups(groups: Array<SlashCommandGroupOptions>) {\n for (const group of groups) {\n let subcommandGroup = new SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);\n\n if (group.subcommands?.length > 0) this.addSubcommands(subcommandGroup, group.subcommands);\n\n this.data.addSubcommandGroup(subcommandGroup);\n }\n }\n}\n\ntype UpperCasedSlashCommandArgumentOptions = 'Attachment' | 'Boolean' | 'Channel' | 'Integer' | 'Mentionable' | 'Number' | 'Role' | 'String' | 'User';\n"]}
|
|
@@ -7,27 +7,35 @@ 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
|
-
|
|
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
40
|
readonly config: Record<string, unknown> | null;
|
|
33
41
|
readonly commands: XernerxCommands;
|
|
@@ -40,4 +48,4 @@ export default class XernerxClient extends Client {
|
|
|
40
48
|
constructor(discordOptions: ClientOptions, xernerxOptions: XernerxOptions, config?: Record<string, unknown>);
|
|
41
49
|
connect(token: string): void;
|
|
42
50
|
}
|
|
43
|
-
//# sourceMappingURL=XernerxClient.d.ts.map
|
|
51
|
+
//# sourceMappingURL=XernerxClient.d.ts.map
|
|
@@ -12,39 +12,39 @@ export default class XernerxClient extends Client {
|
|
|
12
12
|
super(discordOptions);
|
|
13
13
|
this.settings = z
|
|
14
14
|
.object({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
local: z.string().or(z.undefined()).optional(),
|
|
16
|
+
global: z.boolean().default(false).optional(),
|
|
17
|
+
ownerId: z.string().or(z.array(z.string())).default([]),
|
|
18
|
+
permissions: z
|
|
19
|
+
.object({
|
|
20
|
+
client: z.array(z.string()).default([]),
|
|
21
|
+
user: z.array(z.string()).default([]),
|
|
22
|
+
dm: z.boolean().default(false),
|
|
23
|
+
})
|
|
24
|
+
.optional(),
|
|
25
|
+
ignore: z
|
|
26
|
+
.object({
|
|
27
|
+
owner: z.boolean().default(false),
|
|
28
|
+
users: z.array(z.string()).default([]),
|
|
29
|
+
channels: z.array(z.string()).default([]),
|
|
30
|
+
guilds: z.array(z.string()).default([]),
|
|
31
|
+
})
|
|
32
|
+
.optional(),
|
|
33
|
+
log: z
|
|
34
|
+
.object({
|
|
35
|
+
ready: z.boolean().default(false),
|
|
36
|
+
info: z.boolean().default(false),
|
|
37
|
+
error: z.boolean().default(false),
|
|
38
|
+
table: z.array(z.string()).or(z.null()).default(null),
|
|
39
|
+
})
|
|
40
|
+
.optional(),
|
|
41
|
+
cooldown: z
|
|
42
|
+
.object({
|
|
43
|
+
command: z.number().default(0),
|
|
44
|
+
cache: z.number().default(0),
|
|
45
|
+
})
|
|
46
|
+
.optional(),
|
|
23
47
|
})
|
|
24
|
-
.optional(),
|
|
25
|
-
ignore: z
|
|
26
|
-
.object({
|
|
27
|
-
owner: z.boolean().default(false),
|
|
28
|
-
users: z.array(z.string()).default([]),
|
|
29
|
-
channels: z.array(z.string()).default([]),
|
|
30
|
-
guilds: z.array(z.string()).default([]),
|
|
31
|
-
})
|
|
32
|
-
.optional(),
|
|
33
|
-
log: z
|
|
34
|
-
.object({
|
|
35
|
-
ready: z.boolean().default(false),
|
|
36
|
-
info: z.boolean().default(false),
|
|
37
|
-
error: z.boolean().default(false),
|
|
38
|
-
table: z.array(z.string()).or(z.null()).default(null),
|
|
39
|
-
})
|
|
40
|
-
.optional(),
|
|
41
|
-
cooldown: z
|
|
42
|
-
.object({
|
|
43
|
-
command: z.number().default(0),
|
|
44
|
-
cache: z.number().default(0),
|
|
45
|
-
})
|
|
46
|
-
.optional(),
|
|
47
|
-
})
|
|
48
48
|
.parse(xernerxOptions);
|
|
49
49
|
this.config = config || null;
|
|
50
50
|
this.commands = {
|
|
@@ -80,4 +80,4 @@ export default class XernerxClient extends Client {
|
|
|
80
80
|
new XernerxLog(this).ready();
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
//# sourceMappingURL=XernerxClient.js.map
|
|
83
|
+
//# sourceMappingURL=XernerxClient.js.map
|
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XernerxShardClient.d.ts","sourceRoot":"","sources":["../../src/client/XernerxShardClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAS,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxF,UAAU,cAAc;IACpB,GAAG,CAAC,EAAE;QACF,IAAI,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACL;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,eAAe;IAC3D,SAAwB,KAAK;;;;MAAC;IACf,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;gBAE3B,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,CAAC,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"XernerxShardClient.d.ts","sourceRoot":"","sources":["../../src/client/XernerxShardClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAS,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxF,UAAU,cAAc;IACpB,GAAG,CAAC,EAAE;QACF,IAAI,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACL;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,eAAe;IAC3D,SAAwB,KAAK;;;;MAAC;IACf,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;gBAE3B,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,CAAC,EAAE,cAAc;CA2CpG"}
|
|
@@ -6,26 +6,32 @@ export default class XernerxShardClient extends ShardingManager {
|
|
|
6
6
|
this.stats = { guildCount: 0, userCount: 0, shardCount: 0 };
|
|
7
7
|
this.user = null;
|
|
8
8
|
this.on('shardCreate', async (shard) => {
|
|
9
|
-
shard
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
shard
|
|
10
|
+
.on('ready', async () => {
|
|
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
|
+
.on('error', (error) => {
|
|
21
|
+
new XernerxLog({ settings: xernerxOptions }).info(`An error occurred in ${shard.id} for ${this.user?.tag}! ${error}`);
|
|
22
|
+
});
|
|
19
23
|
});
|
|
20
24
|
this.spawn().then(async (shards) => {
|
|
21
25
|
const collector = setInterval(() => {
|
|
22
26
|
const index = shards.size - 1;
|
|
23
27
|
if (shards.get(index)?.ready) {
|
|
24
|
-
new XernerxLog({ settings: xernerxOptions }).info(
|
|
28
|
+
new XernerxLog({ settings: xernerxOptions }).info(
|
|
29
|
+
`Launched all ${this.stats.shardCount} shards for ${this.user?.tag}, watching ${this.stats.guildCount} guilds, and ${this.stats.userCount} users!`
|
|
30
|
+
);
|
|
25
31
|
clearInterval(collector);
|
|
26
32
|
}
|
|
27
33
|
}, 1000);
|
|
28
34
|
});
|
|
29
35
|
}
|
|
30
36
|
}
|
|
31
|
-
//# sourceMappingURL=XernerxShardClient.js.map
|
|
37
|
+
//# sourceMappingURL=XernerxShardClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XernerxShardClient.js","sourceRoot":"","sources":["../../src/client/XernerxShardClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA6C,MAAM,YAAY,CAAC;AACxF,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAQhD,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,eAAe;IAI3D,YAAY,IAAY,EAAE,cAAsC,EAAE,cAA+B;QAC7F,KAAK,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAE5B,IAAI,CAAC,KAAK,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QAE5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACnC,KAAK,
|
|
1
|
+
{"version":3,"file":"XernerxShardClient.js","sourceRoot":"","sources":["../../src/client/XernerxShardClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA6C,MAAM,YAAY,CAAC;AACxF,OAAO,UAAU,MAAM,wBAAwB,CAA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I,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAW,CAAC,CAAC,IAAI,CAAC,kBAAkB,KAAK,CAAC,EAAE,QAAQ,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC;YAC1H,CAAC,CAAC;iBACD,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACnB,IAAI,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAW,CAAC,CAAC,IAAI,CAAC,wBAAwB,KAAK,CAAC,EAAE,QAAQ,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC;YACnI,CAAC,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAC/B,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;gBAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;gBAE9B,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE;oBAC1B,IAAI,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAW,CAAC,CAAC,IAAI,CACtD,gBAAgB,IAAI,CAAC,KAAK,CAAC,UAAU,eAAe,IAAI,CAAC,IAAI,EAAE,GAAG,cAAc,IAAI,CAAC,KAAK,CAAC,UAAU,gBAAgB,IAAI,CAAC,KAAK,CAAC,SAAS,SAAS,CACrJ,CAAC;oBAEF,aAAa,CAAC,SAAS,CAAC,CAAC;iBAC5B;YACL,CAAC,EAAE,IAAI,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import { ShardingManager, ShardingManagerOptions, Guild, ClientUser } from 'discord.js';\nimport XernerxLog from '../tools/XernerxLog.js';\n\ninterface XernerxOptions {\n log?: {\n info?: boolean;\n };\n}\n\nexport default class XernerxShardClient extends ShardingManager {\n public declare readonly stats;\n public declare user: ClientUser | null;\n\n constructor(file: string, discordOptions: ShardingManagerOptions, xernerxOptions?: XernerxOptions) {\n super(file, discordOptions);\n\n this.stats = { guildCount: 0, userCount: 0, shardCount: 0 };\n\n this.user = null;\n\n this.on('shardCreate', async (shard) => {\n shard\n .on('ready', async () => {\n const guilds = (await shard.fetchClientValue('guilds.cache')) as Array<Guild>;\n const guildCount = guilds.length;\n const userCount = guilds.map((guild) => guild.memberCount).length ? guilds.map((guild) => guild.memberCount).reduce((a, b) => (a += b)) : 0;\n\n this.stats.guildCount += Number(guildCount);\n\n this.stats.userCount += Number(userCount);\n\n this.stats.shardCount++;\n\n this.user = (await shard.fetchClientValue('user')) as ClientUser;\n\n await new XernerxLog({ settings: xernerxOptions } as never).info(`Launched shard ${shard.id} for ${this.user?.tag}!`);\n })\n .on('error', (error) => {\n new XernerxLog({ settings: xernerxOptions } as never).info(`An error occurred in ${shard.id} for ${this.user?.tag}! ${error}`);\n });\n });\n\n this.spawn().then(async (shards) => {\n const collector = setInterval(() => {\n const index = shards.size - 1;\n\n if (shards.get(index)?.ready) {\n new XernerxLog({ settings: xernerxOptions } as never).info(\n `Launched all ${this.stats.shardCount} shards for ${this.user?.tag}, watching ${this.stats.guildCount} guilds, and ${this.stats.userCount} users!`\n );\n\n clearInterval(collector);\n }\n }, 1000);\n });\n }\n}\n"]}
|
|
@@ -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
|
@@ -5,33 +5,30 @@ const commands = { slash: [], context: [] };
|
|
|
5
5
|
export default function deploy(client, type) {
|
|
6
6
|
client.prependOnceListener('ready', (client) => {
|
|
7
7
|
commands[type] = client.commands[type].map((command) => command.data.toJSON());
|
|
8
|
-
if (!(!!client.modules.options.slash && !!client.modules.options.context && commands.slash.length > 0 && commands.context.length > 0))
|
|
9
|
-
return;
|
|
8
|
+
if (!(!!client.modules.options.slash && !!client.modules.options.context && commands.slash.length > 0 && commands.context.length > 0)) return;
|
|
10
9
|
try {
|
|
11
10
|
if (client.settings.global) {
|
|
12
11
|
put(client, client.settings.global, [...commands.slash, ...commands.context]);
|
|
13
12
|
put(client, !client.settings.global, []);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
13
|
+
} else {
|
|
16
14
|
put(client, !client.settings.global, [...commands.slash, ...commands.context]);
|
|
17
15
|
put(client, client.settings.global, []);
|
|
18
16
|
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
17
|
+
} catch (error) {
|
|
21
18
|
new XernerxLog(client).error(`An error occurred while deploying the interaction commands!`, error);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
} finally {
|
|
20
|
+
new XernerxLog(client).info(
|
|
21
|
+
`Deployed ${[client.commands.message.size, client.commands.slash.size, client.commands.context.size].reduce((a, b) => (a += b))} Commands ${
|
|
22
|
+
client.settings.global ? 'globally' : 'locally'
|
|
23
|
+
}.`
|
|
24
|
+
);
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
function put(client, global, body) {
|
|
29
29
|
const rest = new REST({ version: GatewayVersion }).setToken(client.token);
|
|
30
|
-
if (!global && !client.settings?.local)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
rest.put(Routes.applicationGuildCommands(client.user?.id, client.settings.local), { body });
|
|
34
|
-
else
|
|
35
|
-
rest.put(Routes.applicationCommands(client.user?.id), { body });
|
|
30
|
+
if (!global && !client.settings?.local) throw new XernerxError(`No guild ID provided as local guild!`);
|
|
31
|
+
if (!global && client.settings?.local) rest.put(Routes.applicationGuildCommands(client.user?.id, client.settings.local), { body });
|
|
32
|
+
else rest.put(Routes.applicationCommands(client.user?.id), { body });
|
|
36
33
|
}
|
|
37
|
-
//# sourceMappingURL=deploy.js.map
|
|
34
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -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 isOwner(user: Pick<XernerxUser, 'id'>, client: XernerxClient): boolean;
|
|
4
|
-
//# sourceMappingURL=isOwner.d.ts.map
|
|
4
|
+
//# sourceMappingURL=isOwner.d.ts.map
|
|
@@ -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
|
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
|