Hi,
I'm currently @ the latest nightly and started getting weird (out-of-sync?) behavior regarding the member update event and the roles before/after - I'm checking whether the member had / has the server booster role by ID (single server owned by me):
- A person applies boost
- BOTH
args.RolesBeforeandargs.RolesAftercontain the booster role
This weird (wrong?) behavior seems to occur only if the member added 2 or more boosts. With a single one it works as expected - the roles before does not contain the booster role while the roles after does contain the booster role.
The member update event always occurs only once.
Wondering whether it's some caching (therefore lib related) issue (or similar) or discord itself being special.
As far as I remember before updating the lib from 5.0.0-nightly-02304 to latest (first 5.0.0-nightly-02512 now 5.0.0-nightly-02531) I didn't experience such issue but also I didn't use this feature (boost tracking) for quite some time (hence the bigger version bump).
Check is done via:
var hasBoostNow = args.RolesAfter.FirstOrDefault(r => r.Id == _options.Value.BoosterRoleId) is not null;
var hadBoostBefore = args.RolesBefore.FirstOrDefault(r => r.Id == _options.Value.BoosterRoleId) is not null;
_logger.LogInformation("Checking member: {MemberUsername}:{MemberDisplayName} for booster role - had: {Had}, has: {Has}", args.Member.Username, args.Member.DisplayName, hadBoostBefore, hasBoostNow);