xernerx 4.5.5 → 4.5.6

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.
Files changed (35) hide show
  1. package/dist/tools/XernerxLog.js +2 -2
  2. package/dist/tools/XernerxLog.js.map +1 -1
  3. package/package.json +1 -1
  4. package/dist/build/ContextCommandBuilder.d.ts +0 -51
  5. package/dist/build/ContextCommandBuilder.d.ts.map +0 -1
  6. package/dist/build/ContextCommandBuilder.js +0 -68
  7. package/dist/build/ContextCommandBuilder.js.map +0 -1
  8. package/dist/build/EventBuilder.d.ts +0 -25
  9. package/dist/build/EventBuilder.d.ts.map +0 -1
  10. package/dist/build/EventBuilder.js +0 -30
  11. package/dist/build/EventBuilder.js.map +0 -1
  12. package/dist/build/InhibitorBuilder.d.ts +0 -29
  13. package/dist/build/InhibitorBuilder.d.ts.map +0 -1
  14. package/dist/build/InhibitorBuilder.js +0 -21
  15. package/dist/build/InhibitorBuilder.js.map +0 -1
  16. package/dist/build/MessageCommandBuilder.d.ts +0 -48
  17. package/dist/build/MessageCommandBuilder.d.ts.map +0 -1
  18. package/dist/build/MessageCommandBuilder.js +0 -61
  19. package/dist/build/MessageCommandBuilder.js.map +0 -1
  20. package/dist/build/SlashCommandBuilder.d.ts +0 -62
  21. package/dist/build/SlashCommandBuilder.d.ts.map +0 -1
  22. package/dist/build/SlashCommandBuilder.js +0 -114
  23. package/dist/build/SlashCommandBuilder.js.map +0 -1
  24. package/dist/functions/delay.d.ts +0 -2
  25. package/dist/functions/delay.d.ts.map +0 -1
  26. package/dist/functions/delay.js +0 -4
  27. package/dist/functions/delay.js.map +0 -1
  28. package/dist/functions/isOwner.d.ts +0 -4
  29. package/dist/functions/isOwner.d.ts.map +0 -1
  30. package/dist/functions/isOwner.js +0 -2
  31. package/dist/functions/isOwner.js.map +0 -1
  32. package/dist/functions/isVoter.d.ts +0 -4
  33. package/dist/functions/isVoter.d.ts.map +0 -1
  34. package/dist/functions/isVoter.js +0 -6
  35. package/dist/functions/isVoter.js.map +0 -1
@@ -25,11 +25,11 @@ export default class XernerxLog {
25
25
  const pkg = await fetch(url)
26
26
  .then(async (res) => await res.json())
27
27
  .catch((pkg) => {
28
- pkg.version, pkg.name;
28
+ pkg.version || version, pkg.name;
29
29
  });
30
30
  if (version != pkg.version)
31
31
  new XernerxLog(true).warn(
32
- `A new version is available, you're using version ${Style.log(version, { color: Style.TextColor.Cyan })}, new version is ${Style.log(pkg.version, {
32
+ `A new version for ${pkg.name} is available, you're using version ${Style.log(version, { color: Style.TextColor.Cyan })}, new version is ${Style.log(pkg.version, {
33
33
  color: Style.TextColor.Cyan,
34
34
  })}, run ${Style.log(`npm i ${pkg.name}@${pkg.version}`, { color: Style.BackgroundColor.Grey })} to update to the latest version.`
35
35
  );
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxLog.js","sourceRoot":"","sources":["../../src/tools/XernerxLog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,MAAM,CAAC,OAAO,OAAO,UAAU;IAQ3B,YAAY,MAA4B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,MAAM,IAAI,IAAI,EAAE;YAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YAErB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;SACvB;aAAM;YACH,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;YAE3C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;YAEzC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;YAE3C,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;SAC9C;QAED,IAAI,CAAC,IAAI,GAAG,GAAG,E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M,CAAC,QAAQ,CAAC,OAAO,EAAE;gBAC9C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,EAAE,CAAC;aACN;YAED,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;gBACpC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,EAAE,CAAC;aACN;YAED,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE;gBACxC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,EAAE,CAAC;aACN;YAED,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;aACvC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import XernerxError from './XernerxError.js';\nimport { Style } from 'dumfunctions';\nimport XernerxClient from '../client/XernerxClient.js';\n\nexport default class XernerxLog {\n private declare readonly client;\n private declare readonly errorLog;\n private declare readonly infoLog;\n private declare readonly readyLog;\n private declare readonly tableLog;\n private declare readonly time;\n\n constructor(client: XernerxClient | true) {\n this.client = client;\n\n if (client == true) {\n this.errorLog = true;\n\n this.infoLog = true;\n } else {\n this.errorLog = client.settings.log?.error;\n\n this.infoLog = client.settings.log?.info;\n\n this.readyLog = client.settings.log?.ready;\n\n this.tableLog = client.settings.log?.table;\n }\n\n this.time = () => String(new Date()).split(/ +/)[4];\n }\n\n public info(message: string, force: boolean = false) {\n return this.infoLog || force\n ? console.info(`✔️ | ${Style.log('Xernerx', { color: Style.TextColor.Purple })} | ${Style.log(this.time(), { color: Style.TextColor.Cyan })} | ${message}`)\n : null;\n }\n\n public warn(message: string) {\n return this.infoLog ? console.warn(`⚠️ | ${Style.log('Xernerx', { color: Style.TextColor.Yellow })} | ${Style.log(this.time(), { color: Style.TextColor.Cyan })} | ${message}`) : null;\n }\n\n public async update(version: string, url: string) {\n const pkg = await fetch(url)\n .then(async (res) => await res.json())\n .catch((pkg) => {\n pkg.version, pkg.name;\n });\n\n if (version != pkg.version)\n new XernerxLog(true).warn(\n `A new version is available, you're using version ${Style.log(version, { color: Style.TextColor.Cyan })}, new version is ${Style.log(pkg.version, {\n color: Style.TextColor.Cyan,\n })}, run ${Style.log(`npm i ${pkg.name}@${pkg.version}`, { color: Style.BackgroundColor.Grey })} to update to the latest version.`\n );\n }\n\n public error(message: string, error?: XernerxError | unknown) {\n return this.errorLog\n ? console.error(\n `❗ | ${Style.log('Xernerx', { color: Style.TextColor.Red })} | ${Style.log(this.time(), { color: Style.TextColor.Cyan })} | ${message}${\n error ? ` | ${(error as Record<string, string>).stack}` : ''\n }`\n )\n : null;\n }\n\n public ready() {\n if (typeof this.client == 'boolean') return;\n\n const client = this.client as XernerxClient;\n\n this.client.prependOnceListener('ready', async (synced) => {\n this.info(\n `${Style.log(synced.user.tag, { color: Style.TextColor.Blue })} is now ${Style.log('online', { color: Style.TextColor.Green })}, watching ${Style.log(\n String(client.guilds.cache.size),\n {\n color: Style.TextColor.Cyan,\n }\n )} guild${client.guilds.cache.size > 1 ? 's' : ''}, using ${\n client.settings.local ? Style.log((await client.guilds.fetch(client.settings.local)).name, { color: Style.TextColor.Blue }) : 'none'\n } as local guild.`,\n this.readyLog\n );\n\n const files: Array<object> = [];\n\n for (const [id, data] of client.commands.message) {\n files.push(data);\n id;\n }\n\n for (const [id, data] of client.commands.slash) {\n files.push(data);\n id;\n }\n\n for (const [id, data] of client.commands.context) {\n files.push(data);\n id;\n }\n\n for (const [id, data] of client.events) {\n files.push(data);\n id;\n }\n\n for (const [id, data] of client.inhibitors) {\n files.push(data);\n id;\n }\n\n if (this.tableLog) {\n console.table(files, this.tableLog);\n }\n });\n }\n}\n"]}
1
+ {"version":3,"file":"XernerxLog.js","sourceRoot":"","sources":["../../src/tools/XernerxLog.ts"],"names":[],"mappings":"AACA,OAAO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C;CACJ","sourcesContent":["import XernerxError from './XernerxError.js';\nimport { Style } from 'dumfunctions';\nimport XernerxClient from '../client/XernerxClient.js';\n\nexport default class XernerxLog {\n private declare readonly client;\n private declare readonly errorLog;\n private declare readonly infoLog;\n private declare readonly readyLog;\n private declare readonly tableLog;\n private declare readonly time;\n\n constructor(client: XernerxClient | true) {\n this.client = client;\n\n if (client == true) {\n this.errorLog = true;\n\n this.infoLog = true;\n } else {\n this.errorLog = client.settings.log?.error;\n\n this.infoLog = client.settings.log?.info;\n\n this.readyLog = client.settings.log?.ready;\n\n this.tableLog = client.settings.log?.table;\n }\n\n this.time = () => String(new Date()).split(/ +/)[4];\n }\n\n public info(message: string, force: boolean = false) {\n return this.infoLog || force\n ? console.info(`✔️ | ${Style.log('Xernerx', { color: Style.TextColor.Purple })} | ${Style.log(this.time(), { color: Style.TextColor.Cyan })} | ${message}`)\n : null;\n }\n\n public warn(message: string) {\n return this.infoLog ? console.warn(`⚠️ | ${Style.log('Xernerx', { color: Style.TextColor.Yellow })} | ${Style.log(this.time(), { color: Style.TextColor.Cyan })} | ${message}`) : null;\n }\n\n public async update(version: string, url: string) {\n const pkg = await fetch(url)\n .then(async (res) => await res.json())\n .catch((pkg) => {\n pkg.version || version, pkg.name;\n });\n\n if (version != pkg.version)\n new XernerxLog(true).warn(\n `A new version for ${pkg.name} is available, you're using version ${Style.log(version, { color: Style.TextColor.Cyan })}, new version is ${Style.log(pkg.version, {\n color: Style.TextColor.Cyan,\n })}, run ${Style.log(`npm i ${pkg.name}@${pkg.version}`, { color: Style.BackgroundColor.Grey })} to update to the latest version.`\n );\n }\n\n public error(message: string, error?: XernerxError | unknown) {\n return this.errorLog\n ? console.error(\n `❗ | ${Style.log('Xernerx', { color: Style.TextColor.Red })} | ${Style.log(this.time(), { color: Style.TextColor.Cyan })} | ${message}${\n error ? ` | ${(error as Record<string, string>).stack}` : ''\n }`\n )\n : null;\n }\n\n public ready() {\n if (typeof this.client == 'boolean') return;\n\n const client = this.client as XernerxClient;\n\n this.client.prependOnceListener('ready', async (synced) => {\n this.info(\n `${Style.log(synced.user.tag, { color: Style.TextColor.Blue })} is now ${Style.log('online', { color: Style.TextColor.Green })}, watching ${Style.log(\n String(client.guilds.cache.size),\n {\n color: Style.TextColor.Cyan,\n }\n )} guild${client.guilds.cache.size > 1 ? 's' : ''}, using ${\n client.settings.local ? Style.log((await client.guilds.fetch(client.settings.local)).name, { color: Style.TextColor.Blue }) : 'none'\n } as local guild.`,\n this.readyLog\n );\n\n const files: Array<object> = [];\n\n for (const [id, data] of client.commands.message) {\n files.push(data);\n id;\n }\n\n for (const [id, data] of client.commands.slash) {\n files.push(data);\n id;\n }\n\n for (const [id, data] of client.commands.context) {\n files.push(data);\n id;\n }\n\n for (const [id, data] of client.events) {\n files.push(data);\n id;\n }\n\n for (const [id, data] of client.inhibitors) {\n files.push(data);\n id;\n }\n\n if (this.tableLog) {\n console.table(files, this.tableLog);\n }\n });\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "4.5.5",
3
+ "version": "4.5.6",
4
4
  "description": "A bot framework for discord.js.",
5
5
  "main": "dist/main.js",
6
6
  "type": "module",
@@ -1,51 +0,0 @@
1
- import { ContextMenuCommandBuilder } from 'discord.js';
2
- import XernerxClient from '../client/XernerxClient.js';
3
- import { XernerxMessageContextInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
4
- import { ContextCommandArguments, ContextCommandOptions } from '../types/interfaces.js';
5
- export default class ContextCommandBuilder {
6
- readonly id: string;
7
- readonly data: ContextMenuCommandBuilder;
8
- readonly name: string;
9
- readonly type: 'user' | 'message';
10
- readonly description: string | null | undefined;
11
- readonly usage: string | null | undefined;
12
- readonly info: string | null | undefined;
13
- readonly category: string | null | undefined;
14
- readonly cooldown: number | null | undefined;
15
- readonly ignore:
16
- | {
17
- owner?: boolean | undefined;
18
- users?: string[] | undefined;
19
- channels?: string[] | undefined;
20
- guilds?: string[] | undefined;
21
- }
22
- | undefined;
23
- readonly strict:
24
- | {
25
- owner?: boolean | undefined;
26
- users?: string[] | undefined;
27
- channels?: string[] | undefined;
28
- guilds?: string[] | undefined;
29
- }
30
- | undefined;
31
- readonly permissions:
32
- | {
33
- user?: string[] | import('../main.js').PermissionNames[] | undefined;
34
- client?: string[] | import('../main.js').PermissionNames[] | undefined;
35
- dm?: boolean | undefined;
36
- }
37
- | undefined;
38
- readonly defer:
39
- | {
40
- reply?: boolean | undefined;
41
- ephemeral?: boolean | undefined;
42
- fetchReply?: boolean | undefined;
43
- }
44
- | undefined;
45
- readonly fileType: 'ContextCommand';
46
- readonly filePath: string;
47
- readonly client: typeof XernerxClient;
48
- constructor(id: string, options: ContextCommandOptions);
49
- exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<void | any | T>;
50
- }
51
- //# sourceMappingURL=ContextCommandBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextCommandBuilder.d.ts","sourceRoot":"","sources":["../../src/build/ContextCommandBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAGvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAExF,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACtC,SAAwB,EAAE,SAAC;IAC3B,SAAwB,IAAI,4BAAC;IAC7B,SAAwB,IAAI,SAAC;IAC7B,SAAwB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,SAAwB,WAAW,4BAAC;IACpC,SAAwB,KAAK,4BAAC;IAC9B,SAAwB,IAAI,4BAAC;IAC7B,SAAwB,QAAQ,4BAAC;IACjC,SAAwB,QAAQ,4BAAC;IACjC,SAAwB,MAAM;;;;;kBAAC;IAC/B,SAAwB,MAAM;;;;;kBAAC;IAC/B,SAAwB,WAAW;;;;kBAAC;IACpC,SAAwB,KAAK;;;;kBAAC;IAC9B,SAAwB,QAAQ,EAAE,gBAAgB,CAAC;IACnD,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,uBAAC;gBAEZ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB;IAgFhD,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,6BAA6B,GAAG,gCAAgC,EAAE,IAAI,EAAE,uBAAuB,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;CAClL"}
@@ -1,68 +0,0 @@
1
- import { ContextMenuCommandBuilder } from 'discord.js';
2
- import { z } from 'zod';
3
- import XernerxClient from '../client/XernerxClient.js';
4
- export default class ContextCommandBuilder {
5
- constructor(id, options) {
6
- this.id = id;
7
- this.data = new ContextMenuCommandBuilder();
8
- this.data.setName(options.name);
9
- this.data.setNameLocalizations(options.nameLocalizations || null);
10
- this.data.setType(options.type === 'user' ? 2 : 3);
11
- this.data.setDMPermission(options.permissions?.dm || null);
12
- options = z
13
- .object({
14
- name: z.string(),
15
- type: z.enum(['user', 'message']),
16
- description: z.string().or(z.null()).default(null),
17
- usage: z.string().or(z.null()).default(null),
18
- info: z.string().or(z.null()).default(null),
19
- category: z.string().or(z.null()).default(null),
20
- cooldown: z.number().or(z.null()).default(null),
21
- ignore: z
22
- .object({
23
- owner: z.boolean().default(false),
24
- users: z.array(z.string()).default([]),
25
- channels: z.array(z.string()).default([]),
26
- guilds: z.array(z.string()).default([]),
27
- })
28
- .default({}),
29
- strict: z
30
- .object({
31
- owner: z.boolean().default(false),
32
- users: z.array(z.string()).default([]),
33
- channels: z.array(z.string()).default([]),
34
- guilds: z.array(z.string()).default([]),
35
- })
36
- .default({}),
37
- permissions: z
38
- .object({
39
- user: z.array(z.string()).default([]),
40
- client: z.array(z.string()).default([]),
41
- dm: z.boolean().default(true),
42
- })
43
- .default({}),
44
- defer: z
45
- .object({
46
- reply: z.boolean().default(false),
47
- ephemeral: z.boolean().default(false),
48
- fetch: z.boolean().default(false),
49
- })
50
- .default({}),
51
- })
52
- .parse(options);
53
- this.name = options.name;
54
- this.type = options.type;
55
- this.description = options.description;
56
- this.usage = options.usage;
57
- this.info = options.info;
58
- this.category = options.category;
59
- this.cooldown = options.cooldown;
60
- this.ignore = options.ignore;
61
- this.strict = options.strict;
62
- this.permissions = options.permissions;
63
- this.defer = options.defer;
64
- this.client = XernerxClient;
65
- }
66
- async exec(interaction, args) {}
67
- }
68
- //# sourceMappingURL=ContextCommandBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextCommandBuilder.js","sourceRoot":"","sources":["../../src/build/ContextCommandBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAkBtC,YAAmB,EAAU,EAAE,OAA8B;QACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAyB,EAAE,CAAC;QAE5C,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,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEnD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,WAA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AAC;QAEpB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAEvC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAEvC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAI,WAA6E,EAAE,IAAiD,IAA4B,CAAC;CACrL","sourcesContent":["import { ContextMenuCommandBuilder } from 'discord.js';\nimport { z } from 'zod';\n\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxMessageContextInteraction, XernerxUserContextInteraction } from '../types/extenders.js';\nimport { ContextCommandArguments, ContextCommandOptions } from '../types/interfaces.js';\n\nexport default class ContextCommandBuilder {\n public declare readonly id;\n public declare readonly data;\n public declare readonly name;\n public declare readonly type: 'user' | 'message';\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: 'ContextCommand';\n public declare readonly filePath: string;\n public declare readonly client;\n\n public constructor(id: string, options: ContextCommandOptions) {\n this.id = id;\n\n this.data = new ContextMenuCommandBuilder();\n\n this.data.setName(options.name);\n\n this.data.setNameLocalizations(options.nameLocalizations || null);\n\n this.data.setType(options.type === 'user' ? 2 : 3);\n\n this.data.setDMPermission(options.permissions?.dm || null);\n\n options = z\n .object({\n name: z.string(),\n type: z.enum(['user', 'message']),\n description: z.string().or(z.null()).default(null),\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 cooldown: 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.type = options.type;\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 exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<void | any | T> {}\n}\n"]}
@@ -1,25 +0,0 @@
1
- import XernerxClient from '../client/XernerxClient.js';
2
- import { EventBuilderOptions } from '../types/interfaces.js';
3
- import { EventType } from '../types/types.js';
4
- /**
5
- * @description - The event builder for events.
6
- * @param {String} id - The unique ID of the event.
7
- * @param {EventOptions} options - The event options.
8
- */
9
- export default class EventBuilder {
10
- readonly id: string;
11
- readonly name: EventType | string;
12
- readonly emitter?: 'client' | 'process' | string;
13
- readonly type?: 'discord' | string;
14
- readonly once?: boolean;
15
- readonly fileType: 'Event';
16
- readonly filePath: string;
17
- readonly client: typeof XernerxClient;
18
- constructor(id: string, options: EventBuilderOptions);
19
- /**
20
- * @description run your custom event here.
21
- * TODO - update description
22
- */
23
- run(...args: any): Promise<void>;
24
- }
25
- //# sourceMappingURL=EventBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventBuilder.d.ts","sourceRoot":"","sources":["../../src/build/EventBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC7B,SAAwB,EAAE,EAAE,MAAM,CAAC;IACnC,SAAwB,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACjD,SAAwB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAChE,SAAwB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAClD,SAAwB,IAAI,CAAC,EAAE,OAAO,CAAC;IACvC,SAAwB,QAAQ,EAAE,OAAO,CAAC;IAC1C,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,uBAAC;gBAEZ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;IAoB3D;;;OAGG;IACU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG;CAChC"}
@@ -1,30 +0,0 @@
1
- import { z } from 'zod';
2
- import XernerxClient from '../client/XernerxClient.js';
3
- // import { EventOptions } from '../types/options.js';
4
- /**
5
- * @description - The event builder for events.
6
- * @param {String} id - The unique ID of the event.
7
- * @param {EventOptions} options - The event options.
8
- */
9
- export default class EventBuilder {
10
- constructor(id, options) {
11
- this.id = id;
12
- z.object({
13
- name: z.string(),
14
- emitter: z.string().optional(),
15
- type: z.string().optional(),
16
- once: z.boolean().optional(),
17
- }).parse(options);
18
- this.name = options.name;
19
- this.emitter = options.emitter || 'client';
20
- this.type = options.type || 'discord';
21
- this.once = options.once || false;
22
- this.client = XernerxClient;
23
- }
24
- /**
25
- * @description run your custom event here.
26
- * TODO - update description
27
- */
28
- async run(...args) {}
29
- }
30
- //# sourceMappingURL=EventBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventBuilder.js","sourceRoot":"","sources":["../../src/build/EventBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAGvD,sDAAsD;AAEtD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAU7B,YAAmB,EAAU,EAAE,OAA4B;QACvD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC,MAAM,CAAC;YACL,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;SAC/B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC;QAE3C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,CAAC;QAEtC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAAC;QAElC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;IAChC,CAAC;IACD;;;OAGG;IACI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAS,IAAG,CAAC;CACpC","sourcesContent":["import { z } from 'zod';\n\nimport XernerxClient from '../client/XernerxClient.js';\nimport { EventBuilderOptions } from '../types/interfaces.js';\nimport { EventType } from '../types/types.js';\n// import { EventOptions } from '../types/options.js';\n\n/**\n * @description - The event builder for events.\n * @param {String} id - The unique ID of the event.\n * @param {EventOptions} options - The event options.\n */\nexport default class EventBuilder {\n public declare readonly id: string;\n public declare readonly name: EventType | string;\n public declare readonly emitter?: 'client' | 'process' | string;\n public declare readonly type?: 'discord' | string;\n public declare readonly once?: boolean;\n public declare readonly fileType: 'Event';\n public declare readonly filePath: string;\n public declare readonly client;\n\n public constructor(id: string, options: EventBuilderOptions) {\n this.id = id;\n\n z.object({\n name: z.string(),\n emitter: z.string().optional(),\n type: z.string().optional(),\n once: z.boolean().optional(),\n }).parse(options);\n\n this.name = options.name;\n\n this.emitter = options.emitter || 'client';\n\n this.type = options.type || 'discord';\n\n this.once = options.once || false;\n\n this.client = XernerxClient;\n }\n /**\n * @description run your custom event here.\n * TODO - update description\n */\n public async run(...args: any) {}\n}\n"]}
@@ -1,29 +0,0 @@
1
- import XernerxClient from '../client/XernerxClient.js';
2
- import { InhibitorBuilderOptions, MessageCommandArguments, SlashCommandArguments } from '../types/interfaces.js';
3
- import { InhibitorType, XernerxInteraction } from '../types/types.js';
4
- import { XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
5
- /**
6
- * @description - The inhibitor builder for inhibitors.
7
- * @param {String} id - The unique ID of the inhibitor.
8
- * @param {InhibitorOptions} options - The inhibitor options.
9
- */
10
- export default class InhibitorBuilder {
11
- readonly id: string;
12
- readonly name: string;
13
- readonly type: InhibitorType;
14
- readonly fileType: 'Inhibitor';
15
- readonly filePath: string;
16
- readonly client: typeof XernerxClient;
17
- constructor(id: string, options: InhibitorBuilderOptions);
18
- check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(
19
- interaction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
20
- args: T extends XernerxMessage
21
- ? MessageCommandArguments
22
- : T extends XernerxSlashInteraction
23
- ? SlashCommandArguments
24
- : T extends XernerxUserContextInteraction
25
- ? XernerxUserContextInteraction
26
- : XernerxMessageContextInteraction | null
27
- ): Promise<void | any | T>;
28
- }
29
- //# sourceMappingURL=InhibitorBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InhibitorBuilder.d.ts","sourceRoot":"","sources":["../../src/build/InhibitorBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,gCAAgC,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAEjJ;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACjC,SAAwB,EAAE,SAAC;IAC3B,SAAwB,IAAI,SAAC;IAC7B,SAAwB,IAAI,EAAE,aAAa,CAAC;IAC5C,SAAwB,QAAQ,EAAE,WAAW,CAAC;IAC9C,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,uBAAC;gBAEZ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;IAelD,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,6BAA6B,GAAG,gCAAgC,CAAC,EACxJ,WAAW,EAAE,cAAc,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,6BAA6B,GAAG,gCAAgC,CAAC,EAC5I,IAAI,EAAE,CAAC,SAAS,cAAc,GACxB,uBAAuB,GACvB,CAAC,SAAS,uBAAuB,GACjC,qBAAqB,GACrB,CAAC,SAAS,6BAA6B,GACvC,6BAA6B,GAC7B,gCAAgC,GAAG,IAAI,GAC9C,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;CAC7B"}
@@ -1,21 +0,0 @@
1
- import { z } from 'zod';
2
- import XernerxClient from '../client/XernerxClient.js';
3
- /**
4
- * @description - The inhibitor builder for inhibitors.
5
- * @param {String} id - The unique ID of the inhibitor.
6
- * @param {InhibitorOptions} options - The inhibitor options.
7
- */
8
- export default class InhibitorBuilder {
9
- constructor(id, options) {
10
- this.id = id;
11
- z.object({
12
- name: z.string(),
13
- type: z.string(),
14
- }).parse(options);
15
- this.name = options.name;
16
- this.type = options.type;
17
- this.client = XernerxClient;
18
- }
19
- async check(interaction, args) {}
20
- }
21
- //# sourceMappingURL=InhibitorBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InhibitorBuilder.js","sourceRoot":"","sources":["../../src/build/InhibitorBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAKvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAQjC,YAAmB,EAAU,EAAE,OAAgC;QAC3D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC,MAAM,CAAC;YACL,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SACnB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,KAAK,CACd,WAA4I,EAC5I,IAM6C,IACrB,CAAC;CAChC","sourcesContent":["import { z } from 'zod';\n\nimport XernerxClient from '../client/XernerxClient.js';\nimport { InhibitorBuilderOptions, MessageCommandArguments, SlashCommandArguments } from '../types/interfaces.js';\nimport { InhibitorType, XernerxInteraction } from '../types/types.js';\nimport { XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';\n\n/**\n * @description - The inhibitor builder for inhibitors.\n * @param {String} id - The unique ID of the inhibitor.\n * @param {InhibitorOptions} options - The inhibitor options.\n */\nexport default class InhibitorBuilder {\n public declare readonly id;\n public declare readonly name;\n public declare readonly type: InhibitorType;\n public declare readonly fileType: 'Inhibitor';\n public declare readonly filePath: string;\n public declare readonly client;\n\n public constructor(id: string, options: InhibitorBuilderOptions) {\n this.id = id;\n\n z.object({\n name: z.string(),\n type: z.string(),\n }).parse(options);\n\n this.name = options.name;\n\n this.type = options.type;\n\n this.client = XernerxClient;\n }\n\n public async check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(\n interaction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n args: T extends XernerxMessage\n ? MessageCommandArguments\n : T extends XernerxSlashInteraction\n ? SlashCommandArguments\n : T extends XernerxUserContextInteraction\n ? XernerxUserContextInteraction\n : XernerxMessageContextInteraction | null\n ): Promise<void | any | T> {}\n}\n"]}
@@ -1,48 +0,0 @@
1
- import XernerxClient from '../client/XernerxClient.js';
2
- import { XernerxMessage } from '../types/extenders.js';
3
- import { MessageCommandArguments, MessageCommandOptions } from '../types/interfaces.js';
4
- export default class MessageCommandBuilder {
5
- readonly id: string;
6
- readonly name: string;
7
- readonly aliases: string[] | undefined;
8
- readonly regex: RegExp | undefined;
9
- readonly prefix: string | string[] | undefined;
10
- readonly description: string | null | undefined;
11
- readonly usage: string | null | undefined;
12
- readonly info: string | null | undefined;
13
- readonly separator: string | undefined;
14
- readonly args: import('../types/interfaces.js').MessageCommandArgumentOptions[] | undefined;
15
- readonly flags: import('../types/interfaces.js').MessageCommandFlagOptions[] | undefined;
16
- readonly category: string | null | undefined;
17
- readonly cooldown: number | null | undefined;
18
- readonly ignore:
19
- | {
20
- owner?: boolean | undefined;
21
- users?: string[] | undefined;
22
- channels?: string[] | undefined;
23
- guilds?: string[] | undefined;
24
- }
25
- | undefined;
26
- readonly strict:
27
- | {
28
- owner?: boolean | undefined;
29
- users?: string[] | undefined;
30
- channels?: string[] | undefined;
31
- guilds?: string[] | undefined;
32
- }
33
- | undefined;
34
- readonly permissions:
35
- | {
36
- user?: string[] | import('../main.js').PermissionNames[] | undefined;
37
- client?: string[] | import('../main.js').PermissionNames[] | undefined;
38
- dm?: boolean | undefined;
39
- }
40
- | undefined;
41
- readonly fileType: 'MessageCommand';
42
- readonly filePath: string;
43
- readonly client: typeof XernerxClient;
44
- constructor(id: string, options: MessageCommandOptions);
45
- conditions<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T>;
46
- exec<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T>;
47
- }
48
- //# sourceMappingURL=MessageCommandBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MessageCommandBuilder.d.ts","sourceRoot":"","sources":["../../src/build/MessageCommandBuilder.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAExF,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACtC,SAAwB,EAAE,SAAC;IAC3B,SAAwB,IAAI,SAAC;IAC7B,SAAwB,OAAO,uBAAC;IAChC,SAAwB,KAAK,qBAAC;IAC9B,SAAwB,MAAM,gCAAC;IAC/B,SAAwB,WAAW,4BAAC;IACpC,SAAwB,KAAK,4BAAC;IAC9B,SAAwB,IAAI,4BAAC;IAC7B,SAAwB,SAAS,qBAAC;IAClC,SAAwB,IAAI,+EAAC;IAC7B,SAAwB,KAAK,2EAAC;IAC9B,SAAwB,QAAQ,4BAAC;IACjC,SAAwB,QAAQ,4BAAC;IACjC,SAAwB,MAAM;;;;;kBAAC;IAC/B,SAAwB,MAAM;;;;;kBAAC;IAC/B,SAAwB,WAAW;;;;kBAAC;IACpC,SAAwB,QAAQ,EAAE,gBAAgB,CAAC;IACnD,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,uBAAC;gBAEZ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB;IAwEhD,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;IAEzG,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;CACnH"}
@@ -1,61 +0,0 @@
1
- import { z } from 'zod';
2
- import XernerxClient from '../client/XernerxClient.js';
3
- export default class MessageCommandBuilder {
4
- constructor(id, options) {
5
- this.id = id;
6
- this.regex = options.regex;
7
- this.args = options.args;
8
- this.flags = options.flags;
9
- options = z
10
- .object({
11
- name: z.string(),
12
- aliases: z.array(z.string()).default([]),
13
- description: z.string().or(z.null()).default(null),
14
- usage: z.string().or(z.null()).default(null),
15
- info: z.string().or(z.null()).default(null),
16
- category: z.string().or(z.null()).default(null),
17
- cooldown: z.number().or(z.null()).default(null),
18
- prefix: z.array(z.string()).or(z.string()).default([]),
19
- ignore: z
20
- .object({
21
- owner: z.boolean().default(false),
22
- users: z.array(z.string()).default([]),
23
- channels: z.array(z.string()).default([]),
24
- guilds: z.array(z.string()).default([]),
25
- })
26
- .default({}),
27
- strict: z
28
- .object({
29
- owner: z.boolean().default(false),
30
- users: z.array(z.string()).default([]),
31
- channels: z.array(z.string()).default([]),
32
- guilds: z.array(z.string()).default([]),
33
- })
34
- .default({}),
35
- permissions: z
36
- .object({
37
- user: z.array(z.string()).default([]),
38
- client: z.array(z.string()).default([]),
39
- dm: z.boolean().default(true),
40
- })
41
- .default({}),
42
- })
43
- .parse(options);
44
- this.name = options.name;
45
- this.aliases = options.aliases;
46
- this.prefix = options.prefix;
47
- this.description = options.description;
48
- this.usage = options.usage;
49
- this.info = options.info;
50
- this.category = options.category;
51
- this.cooldown = options.cooldown;
52
- this.ignore = options.ignore;
53
- this.strict = options.strict;
54
- this.separator = options.separator;
55
- this.permissions = options.permissions;
56
- this.client = XernerxClient;
57
- }
58
- async conditions(message, { args, flags }) {}
59
- async exec(message, { args, flags }) {}
60
- }
61
- //# sourceMappingURL=MessageCommandBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MessageCommandBuilder.js","sourceRoot":"","sources":["../../src/build/MessageCommandBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAqBtC,YAAmB,EAAU,EAAE,OAA8B;QACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,OAAO,GAAG,CAAC;aACN,MAAM,CAAC;YACJ,IAAI,EAAE,CAAC,CAAC,MAAM,E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AK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAEnC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAEvC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,UAAU,CAAI,OAAuB,EAAE,EAAE,IAAI,EAAE,KAAK,EAA2B,IAA4B,CAAC;IAElH,KAAK,CAAC,IAAI,CAAI,OAAuB,EAAE,EAAE,IAAI,EAAE,KAAK,EAA2B,IAA4B,CAAC;CACtH","sourcesContent":["import { z } from 'zod';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxMessage } from '../types/extenders.js';\nimport { MessageCommandArguments, MessageCommandOptions } from '../types/interfaces.js';\n\nexport default class MessageCommandBuilder {\n public declare readonly id;\n public declare readonly name;\n public declare readonly aliases;\n public declare readonly regex;\n public declare readonly prefix;\n public declare readonly description;\n public declare readonly usage;\n public declare readonly info;\n public declare readonly separator;\n public declare readonly args;\n public declare readonly flags;\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 fileType: 'MessageCommand';\n public declare readonly filePath: string;\n public declare readonly client;\n\n public constructor(id: string, options: MessageCommandOptions) {\n this.id = id;\n\n this.regex = options.regex;\n\n this.args = options.args;\n\n this.flags = options.flags;\n\n options = z\n .object({\n name: z.string(),\n aliases: z.array(z.string()).default([]),\n description: z.string().or(z.null()).default(null),\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 cooldown: z.number().or(z.null()).default(null),\n prefix: z.array(z.string()).or(z.string()).default([]),\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 })\n .parse(options);\n\n this.name = options.name;\n\n this.aliases = options.aliases;\n\n this.prefix = options.prefix;\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.separator = options.separator;\n\n this.permissions = options.permissions;\n\n this.client = XernerxClient;\n }\n\n public async conditions<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T> {}\n\n public async exec<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T> {}\n}\n"]}
@@ -1,62 +0,0 @@
1
- import Discord from 'discord.js';
2
- import XernerxClient from '../client/XernerxClient.js';
3
- import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
4
- import { SlashCommandArguments, SlashCommandOptions } from '../types/interfaces.js';
5
- import { XernerxInteraction } from '../types/types.js';
6
- export default class SlashCommandBuilder {
7
- readonly id: string;
8
- readonly data: Discord.SlashCommandBuilder;
9
- readonly name: string;
10
- readonly description: string;
11
- readonly usage: string | null | undefined;
12
- readonly info: string | null | undefined;
13
- readonly category: string | null | undefined;
14
- readonly cooldown: number | null | undefined;
15
- readonly ignore:
16
- | {
17
- owner?: boolean | undefined;
18
- users?: string[] | undefined;
19
- channels?: string[] | undefined;
20
- guilds?: string[] | undefined;
21
- }
22
- | undefined;
23
- readonly strict:
24
- | {
25
- owner?: boolean | undefined;
26
- users?: string[] | undefined;
27
- channels?: string[] | undefined;
28
- guilds?: string[] | undefined;
29
- }
30
- | undefined;
31
- readonly permissions:
32
- | {
33
- user?: string[] | import('../types/types.js').PermissionNames[] | undefined;
34
- client?: string[] | import('../types/types.js').PermissionNames[] | undefined;
35
- dm?: boolean | undefined;
36
- }
37
- | undefined;
38
- readonly defer:
39
- | {
40
- reply?: boolean | undefined;
41
- ephemeral?: boolean | undefined;
42
- fetchReply?: boolean | undefined;
43
- }
44
- | undefined;
45
- readonly fileType: 'SlashCommand';
46
- readonly filePath: string;
47
- readonly client: typeof XernerxClient;
48
- constructor(id: string, options: SlashCommandOptions);
49
- autocomplete<T>(interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, focused: T, options: T[]): Promise<void | any | T>;
50
- conditions<T>(
51
- interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
52
- { args, subcommand, group }: SlashCommandArguments
53
- ): Promise<void | any | T>;
54
- exec<T>(
55
- interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
56
- { args, subcommand, group }: SlashCommandArguments
57
- ): Promise<void | any | T>;
58
- private addArguments;
59
- private addSubcommands;
60
- private addSubcommandGroups;
61
- }
62
- //# sourceMappingURL=SlashCommandBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SlashCommandBuilder.d.ts","sourceRoot":"","sources":["../../src/build/SlashCommandBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,OAAwG,MAAM,YAAY,CAAC;AAElI,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,uBAA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EAAE,KAAK,EAAE,EAAE,qBAAqB,GACnD,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;IAE1B,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,mBAAmB;CAS9B"}
@@ -1,114 +0,0 @@
1
- import Discord, { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from 'discord.js';
2
- import { z } from 'zod';
3
- import XernerxClient from '../client/XernerxClient.js';
4
- export default class SlashCommandBuilder {
5
- constructor(id, options) {
6
- this.id = id;
7
- this.data = new Discord.SlashCommandBuilder();
8
- this.data.setName(options.name);
9
- this.data.setNameLocalizations(options.nameLocalizations || null);
10
- this.data.setDescription(options.description);
11
- this.data.setDescriptionLocalizations(options.descriptionLocalizations || null);
12
- this.data.setDMPermission(options.permissions?.dm || null);
13
- if (options.args && options?.args?.length > 0) {
14
- this.addArguments(this.data, options.args);
15
- }
16
- if (options.subcommands && options?.subcommands?.length > 0) {
17
- this.addSubcommands(this.data, options.subcommands);
18
- }
19
- if (options.groups && options?.groups?.length > 0) {
20
- this.addSubcommandGroups(options.groups);
21
- }
22
- options = z
23
- .object({
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({}),
61
- })
62
- .parse(options);
63
- this.name = options.name;
64
- this.description = options.description;
65
- this.usage = options.usage;
66
- this.info = options.info;
67
- this.category = options.category;
68
- this.cooldown = options.cooldown;
69
- this.ignore = options.ignore;
70
- this.strict = options.strict;
71
- this.permissions = options.permissions;
72
- this.defer = options.defer;
73
- this.client = XernerxClient;
74
- }
75
- async autocomplete(interaction, focused, options) {}
76
- async conditions(interaction, { args, subcommand, group }) {}
77
- async exec(interaction, { args, subcommand, group }) {}
78
- addArguments(command, args) {
79
- for (const argument of args) {
80
- let slashCommandArgumentType = `${argument.type.charAt(0).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;
81
- command[`add${slashCommandArgumentType}Option`]((option) => {
82
- option
83
- .setName(argument.name)
84
- .setDescription(argument.description)
85
- .setRequired(argument.required || false);
86
- if (slashCommandArgumentType === 'String') {
87
- if (argument.choices)
88
- option.setChoices(
89
- ...argument.choices.map((choices) => {
90
- return { name: Object.keys(choices).at(0), value: Object.values(choices).at(0) };
91
- })
92
- );
93
- option.setAutocomplete(argument.autocomplete || false);
94
- }
95
- return option;
96
- });
97
- }
98
- }
99
- addSubcommands(method, subcommands) {
100
- for (const subcommand of subcommands) {
101
- let sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);
102
- if (subcommand.args && subcommand?.args?.length > 0) this.addArguments(sub, subcommand.args);
103
- method.addSubcommand(sub);
104
- }
105
- }
106
- addSubcommandGroups(groups) {
107
- for (const group of groups) {
108
- let subcommandGroup = new SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);
109
- if (group.subcommands?.length > 0) this.addSubcommands(subcommandGroup, group.subcommands);
110
- this.data.addSubcommandGroup(subcommandGroup);
111
- }
112
- }
113
- }
114
- //# sourceMappingURL=SlashCommandBuilder.js.map
@@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C,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 { 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"]}
@@ -1,2 +0,0 @@
1
- export default function delay(time: number): Promise<unknown>;
2
- //# sourceMappingURL=delay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../src/functions/delay.ts"],"names":[],"mappings":"AAAA,wBAA8B,KAAK,CAAC,IAAI,EAAE,MAAM,oBAE/C"}
@@ -1,4 +0,0 @@
1
- export default async function delay(time) {
2
- return await new Promise((resolve) => setTimeout(resolve, time));
3
- }
4
- //# sourceMappingURL=delay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delay.js","sourceRoot":"","sources":["../../src/functions/delay.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,KAAK,CAAC,IAAY;IAC5C,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AACrE,CAAC","sourcesContent":["export default async function delay(time: number) {\n return await new Promise((resolve) => setTimeout(resolve, time));\n}\n"]}
@@ -1,4 +0,0 @@
1
- import XernerxClient from '../client/XernerxClient.js';
2
- import { XernerxUser } from '../types/extenders.js';
3
- export default function isOwner(user: Pick<XernerxUser, 'id'>, client: XernerxClient): void;
4
- //# sourceMappingURL=isOwner.d.ts.map
@@ -1 +0,0 @@
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,2 +0,0 @@
1
- export default function isOwner(user, client) {}
2
- //# sourceMappingURL=isOwner.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import XernerxClient from '../client/XernerxClient.js';
2
- import { XernerxUser } from '../types/extenders.js';
3
- export default function isVoter(user: XernerxUser, client: XernerxClient, token: string, host: 'top.gg'): Promise<void>;
4
- //# sourceMappingURL=isVoter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isVoter.d.ts","sourceRoot":"","sources":["../../src/functions/isVoter.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,wBAA8B,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,iBAI5G"}
@@ -1,6 +0,0 @@
1
- import { hasVoted } from 'dbl-sdk';
2
- export default async function isVoter(user, client, token, host) {
3
- const x = await hasVoted(user.id, client.user?.id, token, host);
4
- console.log(x);
5
- }
6
- //# sourceMappingURL=isVoter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isVoter.js","sourceRoot":"","sources":["../../src/functions/isVoter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,OAAO,CAAC,IAAiB,EAAE,MAAqB,EAAE,KAAa,EAAE,IAAc;IACzG,MAAM,CAAC,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,EAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAE1E,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC","sourcesContent":["import { hasVoted } from 'dbl-sdk';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxUser } from '../types/extenders.js';\n\nexport default async function isVoter(user: XernerxUser, client: XernerxClient, token: string, host: 'top.gg') {\n const x = await hasVoted(user.id, client.user?.id as string, token, host);\n\n console.log(x);\n}\n"]}