xernerx 4.5.27 → 4.5.28
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.
|
@@ -13,6 +13,7 @@ export default class XernerxShardClient extends ShardingManager {
|
|
|
13
13
|
shardCount: number;
|
|
14
14
|
};
|
|
15
15
|
user: ClientUser | null;
|
|
16
|
+
spawner: Promise<import("@discordjs/collection").Collection<number, import("discord.js").Shard>>;
|
|
16
17
|
constructor(file: string, discordOptions: ShardingManagerOptions, xernerxOptions?: XernerxOptions);
|
|
17
18
|
}
|
|
18
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XernerxShardClient.d.ts","sourceRoot":"","sources":["../../src/client/XernerxShardClient.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAS,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxF,UAAU,cAAc;IACvB,GAAG,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,eAAe;IAC9D,SAAwB,KAAK;;;;MAAC;IACf,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"XernerxShardClient.d.ts","sourceRoot":"","sources":["../../src/client/XernerxShardClient.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAS,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxF,UAAU,cAAc;IACvB,GAAG,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,eAAe;IAC9D,SAAwB,KAAK;;;;MAAC;IACf,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,OAAO,0FAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,CAAC,EAAE,cAAc;CA8DjG"}
|
|
@@ -26,6 +26,7 @@ export default class XernerxShardClient extends ShardingManager {
|
|
|
26
26
|
setTimeout(() => shard.kill(), xernerxOptions.timeout);
|
|
27
27
|
});
|
|
28
28
|
const spawn = this.spawn();
|
|
29
|
+
this.spawner = spawn;
|
|
29
30
|
spawn.then(async (shards) => {
|
|
30
31
|
const collector = setInterval(() => {
|
|
31
32
|
const index = shards.size - 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XernerxShardClient.js","sourceRoot":"","sources":["../../src/client/XernerxShardClient.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,eAAe,EAA6C,MAAM,YAAY,CAAC;AACxF,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AASrC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,eAAe;
|
|
1
|
+
{"version":3,"file":"XernerxShardClient.js","sourceRoot":"","sources":["../../src/client/XernerxShardClient.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,eAAe,EAA6C,MAAM,YAAY,CAAC;AACxF,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AASrC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,eAAe;IAK9D,YAAY,IAAY,EAAE,cAAsC,EAAE,cAA+B;QAChG,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,CAA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C,IAAI;qBAC3B,CAAC,oBAAoB,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,cAAc,KAAK,CAAC,GAAG,CAClK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAC7B;wBACC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI;qBAC3B,CACD,SAAS,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAC7K,CAAC;oBAEF,aAAa,CAAC,SAAS,CAAC,CAAC;iBACzB;YACF,CAAC,EAAE,IAAI,CAAC,CAAC;QACV,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["/** @format */\n\nimport { ShardingManager, ShardingManagerOptions, Guild, ClientUser } from 'discord.js';\nimport XernerxLog from '../tools/XernerxLog.js';\nimport { Style } from 'dumfunctions';\n\ninterface XernerxOptions {\n\tlog?: {\n\t\tinfo?: boolean;\n\t};\n\ttimeout?: number;\n}\n\nexport default class XernerxShardClient extends ShardingManager {\n\tpublic declare readonly stats;\n\tpublic declare user: ClientUser | null;\n\tpublic declare spawner;\n\n\tconstructor(file: string, discordOptions: ShardingManagerOptions, xernerxOptions?: XernerxOptions) {\n\t\tsuper(file, discordOptions);\n\n\t\tthis.stats = { guildCount: 0, userCount: 0, shardCount: 0 };\n\n\t\tthis.user = null;\n\n\t\tthis.on('shardCreate', async (shard) => {\n\t\t\tshard\n\t\t\t\t.on('ready', async () => {\n\t\t\t\t\tconst guilds = (await shard.fetchClientValue('guilds.cache')) as Array<Guild>;\n\t\t\t\t\tconst guildCount = guilds.length;\n\t\t\t\t\tconst userCount = guilds.map((guild) => guild.memberCount).length ? guilds.map((guild) => guild.memberCount).reduce((a, b) => (a += b)) : 0;\n\n\t\t\t\t\tthis.user = (await shard.fetchClientValue('user')) as ClientUser;\n\n\t\t\t\t\tthis.stats.guildCount += Number(guildCount);\n\n\t\t\t\t\tthis.stats.userCount += Number(userCount);\n\n\t\t\t\t\tthis.stats.shardCount++;\n\n\t\t\t\t\tawait new XernerxLog({ settings: xernerxOptions } as never).info(\n\t\t\t\t\t\t`Launched shard ${Style.log(String(shard.id), { color: Style.TextColor.Cyan })} for ${Style.log(this.user?.tag, { color: Style.TextColor.Blue })}!`\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t\t.on('error', (error) => {\n\t\t\t\t\tnew XernerxLog({ settings: xernerxOptions } as never).info(\n\t\t\t\t\t\t`An error occurred in ${Style.log(String(shard.id), { color: Style.TextColor.Cyan })} for ${Style.log(String(this.user?.tag), { color: Style.TextColor.Blue })}! ${error}`\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\tif (xernerxOptions?.timeout) setTimeout(() => shard.kill(), xernerxOptions.timeout);\n\t\t});\n\n\t\tconst spawn = this.spawn();\n\n\t\tthis.spawner = spawn;\n\n\t\tspawn.then(async (shards) => {\n\t\t\tconst collector = setInterval(() => {\n\t\t\t\tconst index = shards.size - 1;\n\n\t\t\t\tif (shards.get(index)?.ready) {\n\t\t\t\t\tnew XernerxLog({ settings: xernerxOptions } as never).info(\n\t\t\t\t\t\t`All Shards launched for ${Style.log(String(this.user?.tag), {\n\t\t\t\t\t\t\tcolor: Style.TextColor.Blue,\n\t\t\t\t\t\t})} with a total of ${Style.log(String(this.stats.shardCount), { color: Style.TextColor.Cyan })} shard${this.stats.shardCount > 1 ? 's' : ''}, watching ${Style.log(\n\t\t\t\t\t\t\tString(this.stats.guildCount),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolor: Style.TextColor.Cyan,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)} guild${this.stats.guildCount > 1 ? 's' : ''}, and ${Style.log(String(this.stats.userCount), { color: Style.TextColor.Cyan })} user${this.stats.userCount > 1 ? 's' : ''}!`\n\t\t\t\t\t);\n\n\t\t\t\t\tclearInterval(collector);\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t});\n\n\t\treturn this;\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xernerx",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.28",
|
|
4
4
|
"description": "A bot framework for discord.js.",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"start": "npm i && npm fund && npm audit fix --force && npm link && tsc -w",
|
|
25
25
|
"commit": "npm run write && git add . && node ./.github/scripts/message.js",
|
|
26
26
|
"tag": "node ./.github/scripts/tag.js",
|
|
27
|
-
"patch": "npm run commit && npm version patch && npm run tag && git push",
|
|
28
|
-
"minor": "npm run commit && npm version minor && npm run tag && git push",
|
|
29
|
-
"major": "npm run commit && npm version major && npm run tag && git push",
|
|
27
|
+
"patch": "npm run commit && npm version patch && npm run tag && npm publish && git push",
|
|
28
|
+
"minor": "npm run commit && npm version minor && npm run tag && npm publish && git push",
|
|
29
|
+
"major": "npm run commit && npm version major && npm run tag && npm publish && git push",
|
|
30
30
|
"site": "git add docs && npm run commit && git push",
|
|
31
31
|
"write": "npm i && npm run build && npm run format",
|
|
32
32
|
"format": "npx prettier --write src dist",
|