From c1c64575985de28aa1d373e14a313e54c7786baf Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 4 Jul 2021 21:40:30 -0400 Subject: [PATCH] Separate member_update and presence_update events --- discord/state.py | 2 +- docs/api.rst | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/discord/state.py b/discord/state.py index f4a6a664c..6ebcfcec6 100644 --- a/discord/state.py +++ b/discord/state.py @@ -628,7 +628,7 @@ class ConnectionState: if user_update: self.dispatch('user_update', user_update[0], user_update[1]) - self.dispatch('member_update', old_member, member) + self.dispatch('presence_update', old_member, member) def parse_user_update(self, data): self.user._update(data) diff --git a/docs/api.rst b/docs/api.rst index 5961ee06f..ab456e49b 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -808,8 +808,6 @@ to handle it, which defaults to print a traceback and ignoring the exception. This is called when one or more of the following things change: - - status - - activity - nickname - roles - pending @@ -821,6 +819,24 @@ to handle it, which defaults to print a traceback and ignoring the exception. :param after: The updated member's updated info. :type after: :class:`Member` +.. function:: on_presence_update(before, after) + + Called when a :class:`Member` updates their presence. + + This is called when one or more of the following things change: + + - status + - activity + + This requires :attr:`Intents.presences` and :attr:`Intents.members` to be enabled. + + .. versionadded:: 2.0 + + :param before: The updated member's old info. + :type before: :class:`Member` + :param after: The updated member's updated info. + :type after: :class:`Member` + .. function:: on_user_update(before, after) Called when a :class:`User` updates their profile.