mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-12 16:59:50 +00:00
Separate member_update and presence_update events
This commit is contained in:
parent
c2acb0a114
commit
c1c6457598
@ -628,7 +628,7 @@ class ConnectionState:
|
|||||||
if user_update:
|
if user_update:
|
||||||
self.dispatch('user_update', user_update[0], user_update[1])
|
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):
|
def parse_user_update(self, data):
|
||||||
self.user._update(data)
|
self.user._update(data)
|
||||||
|
20
docs/api.rst
20
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:
|
This is called when one or more of the following things change:
|
||||||
|
|
||||||
- status
|
|
||||||
- activity
|
|
||||||
- nickname
|
- nickname
|
||||||
- roles
|
- roles
|
||||||
- pending
|
- 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.
|
:param after: The updated member's updated info.
|
||||||
:type after: :class:`Member`
|
: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)
|
.. function:: on_user_update(before, after)
|
||||||
|
|
||||||
Called when a :class:`User` updates their profile.
|
Called when a :class:`User` updates their profile.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user