#RolesBefore in OnGuildMemberUpdated seems incorrect on first run after bot restart

1 messages · Page 1 of 1 (latest)

mortal pollen
#

Hello! I'm currently experimenting with roles and trying to remove some from a member, if a certain role disappears. I've noticed however, that if I restart my bot, the first time OnGuildMemberUpdated is run, the RolesBefore are not correct and are just == RolesAfter.

I was on 4.4.2 and just updated to 4.4.3 but the issue persists.
I've attached an image of the code I'm running and a breakpoint I've placed, that shows the contents of RolesBefore and RolesAfter. The second time I trigger the event, the contents are correct.

Thanks in advance for your time!

wise pendant
#

Before doesn't actually exist, it's polyfilled from cache and may be stale

#

especially after restarts cache is often wrong