Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/bot-sites.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"enabled": false,
"url": "https://top.gg/api/bots/<BOT_ID>/stats",
"authorization": "<TOKEN>",
"body": "{\"server_count\":{{SERVER_COUNT}}}"
"body": "{\"server_count\":{{SERVER_COUNT}},\"shard_count\":{{SHARD_COUNT}}}"
},
{
"name": "bots.ondiscord.xyz",
Expand Down
5 changes: 4 additions & 1 deletion src/jobs/update-server-count-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class UpdateServerCountJob implements Job {

public async run(): Promise<void> {
let serverCount = await ShardUtils.serverCount(this.shardManager);
let shardCount = ShardUtils.shardIds(this.shardManager).length.toString();

let type = ActivityType.Streaming;
let name = `to ${serverCount.toLocaleString()} servers`;
Expand All @@ -44,7 +45,9 @@ export class UpdateServerCountJob implements Job {
for (let botSite of this.botSites) {
try {
let body = JSON.parse(
botSite.body.replaceAll('{{SERVER_COUNT}}', serverCount.toString())
botSite.body
.replaceAll('{{SERVER_COUNT}}', serverCount.toString())
.replaceAll('{{SHARD_COUNT}}', shardCount)
);
let res = await this.httpService.post(botSite.url, botSite.authorization, body);

Expand Down