Open bkuhl opened 9 months ago
unfortunately, i dont think this project is being maintained anymore... this looks really nice to use (and i find dgo really annoying to use so) i would help but im also brand new, a fucking moron, and idk where to start lol. 😭
We switched to use https://github.com/bwmarrin/discordgo and github.com/servusdei2018/shards for sharding and it's working great.
unfortunately, i dont think this project is being maintained anymore... — @imide
I was homeless.
if you'd be able to add a full example of how to run a sharded bot as I seem to be doing something wrong. — @bkuhl
The short term fix is to use `bot.Config.Gateway.ShardManager.SetNumShards(2)'.
The long term fix is that the Limit struct should not be nil.
I can implement this fix when I want or when I am paid to do so. However, you are using discordgo, so no payment is expected.
Here is what caused the issue.
Line 86 is a reference to totalShards = sm.Limit.RecommendedShards
The instantiated shard manager has a nil Limit struct.
When you call Connect, totalShards is not set, so it attempts to read from a nil pointer.
The shard test doesn't catch this issue because it calls bot.Config.Gateway.ShardManager.SetNumShards(2)
which sets totalShards to 2.
The short term fix is to use that line of code and set the shards to a given number.
The long term fix is to make sure there is a limit set and consider whatever reason I had for not doing so.
Does this package make you use a lot of for
loops to call code on each shard?
I was homeless.
oh no! i hope you're back on your feet 👍🏼
I'm on an ARM OSx device.
I'm not very familiar with golang and am trying to migrate my Discord bot to use your library. It's a sharded bot. I'm following the docs here and am encountering an error I don't understand. I was wondering if you'd be able to add a full example of how to run a sharded bot as I seem to be doing something wrong.
I keep getting