xernerx 4.4.13 → 4.4.14

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 (73) hide show
  1. package/dist/build/ContextCommandBuilder.d.ts +31 -23
  2. package/dist/build/ContextCommandBuilder.js +39 -39
  3. package/dist/build/EventBuilder.d.ts +1 -1
  4. package/dist/build/EventBuilder.js +2 -2
  5. package/dist/build/InhibitorBuilder.d.ts +1 -1
  6. package/dist/build/InhibitorBuilder.js +2 -2
  7. package/dist/build/MessageCommandBuilder.d.ts +26 -20
  8. package/dist/build/MessageCommandBuilder.js +34 -34
  9. package/dist/build/SlashCommandBuilder.d.ts +31 -23
  10. package/dist/build/SlashCommandBuilder.js +48 -48
  11. package/dist/client/XernerxClient.d.ts +30 -22
  12. package/dist/client/XernerxClient.js +33 -33
  13. package/dist/client/XernerxShardClient.d.ts +1 -1
  14. package/dist/client/XernerxShardClient.d.ts.map +1 -1
  15. package/dist/client/XernerxShardClient.js +18 -12
  16. package/dist/client/XernerxShardClient.js.map +1 -1
  17. package/dist/functions/delay.d.ts +1 -1
  18. package/dist/functions/delay.js +1 -1
  19. package/dist/functions/deploy.d.ts +1 -1
  20. package/dist/functions/deploy.js +13 -16
  21. package/dist/functions/isOwner.d.ts +1 -1
  22. package/dist/functions/isOwner.js +1 -1
  23. package/dist/functions/isVoter.d.ts +1 -1
  24. package/dist/functions/isVoter.js +1 -1
  25. package/dist/functions/load.d.ts +1 -1
  26. package/dist/functions/load.js +2 -3
  27. package/dist/functions/reload.d.ts +1 -1
  28. package/dist/functions/reload.js +9 -12
  29. package/dist/functions/sendWebhook.d.ts +1 -1
  30. package/dist/functions/sendWebhook.js +2 -3
  31. package/dist/functions/setPresence.d.ts +2 -2
  32. package/dist/functions/setPresence.js +12 -11
  33. package/dist/functions/xernerxUser.d.ts +1 -1
  34. package/dist/functions/xernerxUser.js +1 -1
  35. package/dist/handlers/CommandHandler.d.ts +1 -1
  36. package/dist/handlers/CommandHandler.js +82 -105
  37. package/dist/handlers/EventHandler.d.ts +1 -1
  38. package/dist/handlers/EventHandler.js +3 -3
  39. package/dist/handlers/ExtensionHandler.d.ts +1 -1
  40. package/dist/handlers/ExtensionHandler.js +3 -5
  41. package/dist/handlers/Handler.d.ts +1 -1
  42. package/dist/handlers/Handler.js +6 -16
  43. package/dist/handlers/InhibitorHandler.d.ts +1 -1
  44. package/dist/handlers/InhibitorHandler.js +3 -3
  45. package/dist/handlers/WebhookHandler.d.ts +2 -4
  46. package/dist/handlers/WebhookHandler.js +9 -6
  47. package/dist/main.d.ts +29 -22
  48. package/dist/main.js +29 -22
  49. package/dist/models/Arguments.d.ts +1 -1
  50. package/dist/models/Arguments.js +48 -63
  51. package/dist/tools/XernerxError.d.ts +1 -1
  52. package/dist/tools/XernerxError.js +1 -1
  53. package/dist/tools/XernerxLog.d.ts +1 -1
  54. package/dist/tools/XernerxLog.js +7 -2
  55. package/dist/types/extenders.d.ts +5 -9
  56. package/dist/types/extenders.js +1 -1
  57. package/dist/types/interfaces.d.ts +9 -6
  58. package/dist/types/interfaces.js +1 -1
  59. package/dist/types/types.d.ts +174 -6
  60. package/dist/types/types.js +1 -1
  61. package/dist/utils/ClientUtil.d.ts +4 -4
  62. package/dist/utils/ClientUtil.js +8 -14
  63. package/dist/utils/InteractionUtil.d.ts +2 -2
  64. package/dist/utils/InteractionUtil.js +1 -1
  65. package/dist/utils/MessageUtil.d.ts +2 -2
  66. package/dist/utils/MessageUtil.js +5 -9
  67. package/dist/utils/Util.d.ts +1 -1
  68. package/dist/utils/Util.js +1 -1
  69. package/dist/validators/commandValidation.d.ts +1 -1
  70. package/dist/validators/commandValidation.js +19 -29
  71. package/dist/validators/inhibitorValidations.d.ts +15 -2
  72. package/dist/validators/inhibitorValidations.js +1 -1
  73. package/package.json +1 -1
@@ -12,39 +12,39 @@ export default class XernerxClient extends Client {
12
12
  super(discordOptions);
13
13
  this.settings = z
14
14
  .object({
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),
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;CAuCpG"}
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.on('ready', async () => {
10
- const guilds = (await shard.fetchClientValue('guilds.cache'));
11
- const guildCount = guilds.length;
12
- const userCount = guilds.map((guild) => guild.memberCount).length ? guilds.map((guild) => guild.memberCount).reduce((a, b) => (a += b)) : 0;
13
- this.stats.guildCount += Number(guildCount);
14
- this.stats.userCount += Number(userCount);
15
- this.stats.shardCount++;
16
- this.user = (await shard.fetchClientValue('user'));
17
- await new XernerxLog({ settings: xernerxOptions }).info(`Launched shard ${shard.id} for ${this.user?.tag}!`);
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(`Launched all ${this.stats.shardCount} shards for ${this.user?.tag}, watching ${this.stats.guildCount} guilds, and ${this.stats.userCount} users!`);
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,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;gBACzB,MAAM,MAAM,GAAG,CAAC,MAAM,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAiB,CAAC;gBAC9E,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;gBACjC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAE5I,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;gBAE5C,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC;gBAE1C,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;gBAExB,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAe,CAAC;gBAEjE,MAAM,IAAI,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,CAAC;QACP,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.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 });\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
+ {"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;iBACA,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;gBACpB,MAAM,MAAM,GAAG,CAAC,MAAM,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAiB,CAAC;gBAC9E,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;gBACjC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAE5I,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;gBAE5C,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC;gBAE1C,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;gBAExB,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAe,CAAC;gBAEjE,MAAM,IAAI,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
@@ -1,4 +1,4 @@
1
1
  export default async function delay(time) {
2
2
  return await new Promise((resolve) => setTimeout(resolve, time));
3
3
  }
4
- //# sourceMappingURL=delay.js.map
4
+ //# sourceMappingURL=delay.js.map
@@ -1,3 +1,3 @@
1
1
  import XernerxClient from '../client/XernerxClient.js';
2
2
  export default function deploy(client: XernerxClient, type: 'slash' | 'context'): void;
3
- //# sourceMappingURL=deploy.d.ts.map
3
+ //# sourceMappingURL=deploy.d.ts.map
@@ -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
- finally {
24
- new XernerxLog(client).info(`Deployed ${[client.commands.message.size, client.commands.slash.size, client.commands.context.size].reduce((a, b) => (a += b))} Commands ${client.settings.global ? 'globally' : 'locally'}.`);
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
- throw new XernerxError(`No guild ID provided as local guild!`);
32
- if (!global && client.settings?.local)
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
  export default function isOwner(user, client) {
2
2
  return client.settings.ownerId.includes(user.id);
3
3
  }
4
- //# sourceMappingURL=isOwner.js.map
4
+ //# sourceMappingURL=isOwner.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 isVoter(user: XernerxUser, client: XernerxClient, token: string, host: 'top.gg'): Promise<void>;
4
- //# sourceMappingURL=isVoter.d.ts.map
4
+ //# sourceMappingURL=isVoter.d.ts.map
@@ -3,4 +3,4 @@ export default async function isVoter(user, client, token, host) {
3
3
  const x = await hasVoted(user.id, client.user?.id, token, host);
4
4
  console.log(x);
5
5
  }
6
- //# sourceMappingURL=isVoter.js.map
6
+ //# sourceMappingURL=isVoter.js.map
@@ -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
@@ -7,8 +7,7 @@ export default async function load(client, path, type) {
7
7
  file.client = client;
8
8
  fileSave(client, file, type);
9
9
  return file;
10
- }
11
- catch (error) {
10
+ } catch (error) {
12
11
  new XernerxLog(client).error(`Couldn't load ${type} ${path.match(/\w*\.js$/gim)?.at(0) || path}`, error);
13
12
  }
14
13
  }
@@ -31,4 +30,4 @@ function fileSave(client, file, type) {
31
30
  break;
32
31
  }
33
32
  }
34
- //# sourceMappingURL=load.js.map
33
+ //# sourceMappingURL=load.js.map
@@ -1,3 +1,3 @@
1
1
  import XernerxClient from '../client/XernerxClient.js';
2
2
  export default function reload(client: XernerxClient, type: 'message' | 'slash' | 'context' | 'event' | 'inhibitor'): Promise<any>[];
3
- //# sourceMappingURL=reload.d.ts.map
3
+ //# sourceMappingURL=reload.d.ts.map
@@ -1,10 +1,10 @@
1
1
  var FileTypes;
2
2
  (function (FileTypes) {
3
- FileTypes["message"] = "MessageCommand";
4
- FileTypes["slash"] = "SlashCommand";
5
- FileTypes["context"] = "ContextCommand";
6
- FileTypes["event"] = "Event";
7
- FileTypes["inhibitor"] = "Inhibitor";
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
- client.commands[type].set(filedata.name, filedata);
36
- if (type === 'event')
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
@@ -1,3 +1,3 @@
1
1
  import { MessagePayload } from 'discord.js';
2
2
  export default function sendWebhook(url: URL, body: MessagePayload): Promise<any>;
3
- //# sourceMappingURL=sendWebhook.d.ts.map
3
+ //# sourceMappingURL=sendWebhook.d.ts.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("discord.js").ClientPresence | undefined;
4
- //# sourceMappingURL=setPresence.d.ts.map
3
+ export default function setPresence(client: XernerxClient, options: PresenceOptions): import('discord.js').ClientPresence | undefined;
4
+ //# sourceMappingURL=setPresence.d.ts.map
@@ -1,14 +1,15 @@
1
1
  export default function setPresence(client, options) {
2
- const presence = () => client.user?.setPresence({
3
- activities: [
4
- {
5
- name: options.text,
6
- type: options.type,
7
- url: options.url,
8
- },
9
- ],
10
- status: options.status,
11
- });
2
+ const presence = () =>
3
+ client.user?.setPresence({
4
+ activities: [
5
+ {
6
+ name: options.text,
7
+ type: options.type,
8
+ url: options.url,
9
+ },
10
+ ],
11
+ status: options.status,
12
+ });
12
13
  let response = presence();
13
14
  if (options.interval)
14
15
  setInterval(() => {
@@ -16,4 +17,4 @@ export default function setPresence(client, options) {
16
17
  }, options.interval);
17
18
  return response;
18
19
  }
19
- //# sourceMappingURL=setPresence.js.map
20
+ //# sourceMappingURL=setPresence.js.map
@@ -1,4 +1,4 @@
1
1
  import XernerxClient from '../client/XernerxClient.js';
2
2
  import { XernerxMessage, XernerxSlashInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';
3
3
  export declare function xernerxUser(event: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction, client: XernerxClient): Promise<XernerxUser>;
4
- //# sourceMappingURL=xernerxUser.d.ts.map
4
+ //# sourceMappingURL=xernerxUser.d.ts.map
@@ -6,4 +6,4 @@ export async function xernerxUser(event, client) {
6
6
  'voted' in user ? null : (user.voted = client.util.hasVoted ? await client.util.hasVoted(user.id) : null);
7
7
  return user;
8
8
  }
9
- //# sourceMappingURL=xernerxUser.js.map
9
+ //# sourceMappingURL=xernerxUser.js.map
@@ -11,4 +11,4 @@ export default class CommandHandler extends Handler {
11
11
  private contextCommandRun;
12
12
  private exec;
13
13
  }
14
- //# sourceMappingURL=CommandHandler.d.ts.map
14
+ //# sourceMappingURL=CommandHandler.d.ts.map