zekroTJA / shinpuru

シンプル - Discord Bot with role selection, moderation, karma ranking, a starboard, code execution, raid alerting, backups, a web interface, twitch notifications and more!
https://shnp.de
MIT License
187 stars 36 forks source link

[BUG] Guild Member Fetching on Startup fails (sometimes) #252

Closed zekroTJA closed 3 years ago

zekroTJA commented 3 years ago

Sometimes on startup, only a fraction of the present guilds are collected for member fetching on ready event.

That might be because the ready listener in the Ready handler occasionally fires before the ready handler of dgrs which caches guilds received on ready event.

The error might be introduced here: https://github.com/zekroTJA/shinpuru/blob/1a361eb3ef98955eafd20e624f4d5b74a7ba8ce0/internal/listeners/ready.go#L81-L83

It might be fixed by using the guilds from the ready event there as well independent of the currently cached guilds, because the list of guilds are the same for both event handlers.