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
- 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!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 this actively decided against or would a PR potentially be accepted
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 weeksdont 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?
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
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