You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Certain events trigger both on_user_update and on_member_update. I have tested this with avatar and username changes.
While I can see the old and new username/avatar in the on_user_update event as expected, both the before and after object only have the new values in the on_member_update event. The URL for the avatar is the same, new one in both, and the username is also the new one in both. If this is intended and only the on_user_update event is supposed to have the correct information in both objects, on_member_update should probably not be triggering.
Bot and user were part of the same guild. Changed username and avatar in separate instances and each time, the described issue happened.
Expected Results
Both events trigger on username and avatar changes, so I expect the before and after objects in both events to actually reflect the state before and after the event.
Actual Results
The before object in on_member_update has the information from after the event, equal to the information from the after object. The information is correct in both objects in the on_user_update event.
That's because members share the same global user cache instance in order to save on memory. This is the reason the on_user_update event exists, since it allows the library to call it during the first time it detects this change.
Summary
Certain events trigger both on_user_update and on_member_update. I have tested this with avatar and username changes.
While I can see the old and new username/avatar in the on_user_update event as expected, both the before and after object only have the new values in the on_member_update event. The URL for the avatar is the same, new one in both, and the username is also the new one in both. If this is intended and only the on_user_update event is supposed to have the correct information in both objects, on_member_update should probably not be triggering.
Reproduction Steps
Implemented the events using:
Bot and user were part of the same guild. Changed username and avatar in separate instances and each time, the described issue happened.
Expected Results
Both events trigger on username and avatar changes, so I expect the before and after objects in both events to actually reflect the state before and after the event.
Actual Results
The before object in on_member_update has the information from after the event, equal to the information from the after object. The information is correct in both objects in the on_user_update event.
Intents
discord.Intents.all()
Checklist
System Information
The text was updated successfully, but these errors were encountered: