Set Presence on Identify per shard using internal sharding?

Is there a way to set a different presence on different shards when using internal sharding?
7 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
d.js docs
d.js docs12mo ago
method ClientUser#setPresence() Sets the full presence of the client user.
Lolo
LoloOP11mo ago
Yeah but we know that on large bots this can cause shard disconnects due to paused events and possibly missing heartbeats so i specifically wanna do it on identify sad, okay thank you thats good ThumbsUp this actively decided against or would a PR potentially be accepted
DD
DD11mo ago
if you want to do it make it only target /ws (not discord.js for now), and make this https://discord.js.org/docs/packages/ws/main/OptionalWebSocketManagerOptions:Interface#initialPresence also take a function like (shardId: number) => T if you can figure everything out yourself, cus its not as trivial as it sounds with all the worker sharding supoort and whatever else otherwise i can do it sometime in the next 2 weeks
Lolo
LoloOP11mo ago
dont think i can do it but i wanted to try anyways assume i wont make it :pog_sheen: may i ask why not to push to djs for now?
DD
DD11mo ago
what do you mean you cant do it within discord.js if /ws doesn't support it first because d.js uses /ws under the hood i told you to hold on the d.js part since i'd prefer they be separate PRs
Lolo
LoloOP10mo ago
i mean i probably cant do it in either but want to try anyways @DD hey again, just looking for a status update. Sadly I can't make time to look into this myself
Want results from more Discord servers?
Add your server