just a question

I'm using the "status-shard" package and I'm curious: how do I get the cluster ID? The status command shows PID, shard ID, and cluster ID, but how do I retrieve the cluster ID?
23 Replies
Digital
Digital14mo ago
<client>.cluster.id assuing you use ShardingClient instead of Discord.js's Client https://help.crni.xyz/status-sharding/getting-started/step-by-step
so friendly
so friendlyOP14mo ago
Eyy Thanks for the quick reply
Digital
Digital14mo ago
np
so friendly
so friendlyOP14mo ago
im either blind as hell or this link doesnt tell me much
Digital
Digital14mo ago
it tells you how to setup a client show me your code if you have an issue and ping me i have server muted
so friendly
so friendlyOP14mo ago
@Digital how to get all clusters/shards ? and i can use the shard client utils for it cant i?
Digital
Digital14mo ago
as in? their stats or
so friendly
so friendlyOP14mo ago
wait i figured out lol
Digital
Digital14mo ago
nice
so friendly
so friendlyOP14mo ago
const shards = client.cluster.totalShards;
const clusters = client.cluster.totalClusters;
const shards = client.cluster.totalShards;
const clusters = client.cluster.totalClusters;
Digital
Digital14mo ago
yes, i thought you mean their actual instances
so friendly
so friendlyOP14mo ago
oh ok
Digital
Digital14mo ago
that's not really possible since each cluster is different process and you can't send classes via ipc (inter process communication)
so friendly
so friendlyOP14mo ago
got it, also sum sad is that i use the djs client for some stuff and i gottachange to status shard client lel u could add more fucntions to the shard utils
Digital
Digital14mo ago
well show me how you declare your client like
so friendly
so friendlyOP14mo ago
total shards total clusters shard used in that guild ccluster used in that guild unless these options are already there and im just blind as hell
Digital
Digital14mo ago
total shards and clusters is directly property as you found here
so friendly
so friendlyOP14mo ago
yee but i gotta change the client inside my prefix builder xd
Digital
Digital14mo ago
as for guild id and cluster id, they are in ShardingUtils lol
so friendly
so friendlyOP14mo ago
and if i use interaction.client it wont use status shard client
Digital
Digital14mo ago
yes, you can just do (interaction.client as YourClientClassWherever).user.id i can't modify inside of discord.js
so friendly
so friendlyOP14mo ago
im confused how? nvm sorry looks like using (client as ShardingClient) made my bot unable to reply for some ungodly reason
Digital
Digital14mo ago
shouldn't show me the code, screenshot

Did you find this page helpful?