#how can i access client property on sharding?
16 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
You still have a client when sharding, I don’t get your question
but it has many processes
like I am using cluster sharding so how it will create multiple client so how can I access cache memory of specific client
Just like that (you access cache of all clients in that code). You can specify the shard you want to call it on if you know which one has the data to reduce data sent over your cluster net
In your case no shard seems to have it in your poru structure
yes I don't have specific shard id
poru just have guild id
(static) ShardClientUtil.shardIdForGuildId()
Get the shard id for a given guild id.
You have the shardId with that then. No need to ask every shard if you know what guild the data is from/on
after receiving shardId what should be way to execute code on specific shard
ShardClientUtil#broadcastEval()
Evaluates a script or function on all shards, or a given shard, in the context of the [Client](<https://discord.js.org/#/docs/discord.js/main/class/Client>)s.
Specify it in the second parameter as shard
Ohk