xernerx 4.4.15 → 4.4.16
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.
|
@@ -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;CA+CpG"}
|
|
@@ -21,7 +21,8 @@ export default class XernerxShardClient extends ShardingManager {
|
|
|
21
21
|
new XernerxLog({ settings: xernerxOptions }).info(`An error occurred in ${shard.id} for ${this.user?.tag}! ${error}`);
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
-
this.spawn()
|
|
24
|
+
const spawn = this.spawn();
|
|
25
|
+
spawn.then(async (shards) => {
|
|
25
26
|
const collector = setInterval(() => {
|
|
26
27
|
const index = shards.size - 1;
|
|
27
28
|
if (shards.get(index)?.ready) {
|
|
@@ -32,6 +33,7 @@ export default class XernerxShardClient extends ShardingManager {
|
|
|
32
33
|
}
|
|
33
34
|
}, 1000);
|
|
34
35
|
});
|
|
36
|
+
return spawn;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
//# 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;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,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Log.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 const spawn = this.spawn();\n\n 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 return spawn as never;\n }\n}\n"]}
|