cordless
cordless copied to clipboard
Add sharding support
How have you installed cordless
- [X] Arch User Repository
- [ ] Snap
- [ ] scoop
- [ ] brew
- [ ] go get
What happened
Attempting to log in as a bot with a bot that is part of more than 2000 servers doesn't work. The websocket is closed with the "Sharding required" message.
How do you reproduce this bug
Log in as a bot that is part of 2k+ servers.
Error output
websocket: close 4011: Sharding required.
How to fix
The only way to solve this problem is to implement sharding.
I actually thought discordgo already supports sharding. Maybe this just needs to be toggled.
Appears there's no documentation about how the sharding exactly works with discordgo. Either way I don't want to implement this myself, as I have no way of testing this. I do not own any bots.
I found this, it might be a simple dependency https://github.com/jonas747/dshardmanager
We'd need integration into https://github.com/Bios-Marcel/discordgo