aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-05-09 22:23:21 -0400
committerRapptz <[email protected]>2021-06-08 07:29:17 -0400
commitbd369c76ea5424f65e37d84bfb45df1c76a4e739 (patch)
tree435f8a36703721a4ef74ef0a4682dd5dd8655a3c /docs
parentAdd ThreadMember.thread (diff)
downloaddiscord.py-bd369c76ea5424f65e37d84bfb45df1c76a4e739.tar.xz
discord.py-bd369c76ea5424f65e37d84bfb45df1c76a4e739.zip
Parse remaining thread events.
Diffstat (limited to 'docs')
-rw-r--r--docs/api.rst50
1 files changed, 47 insertions, 3 deletions
diff --git a/docs/api.rst b/docs/api.rst
index 4282373e..395de477 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -658,10 +658,42 @@ to handle it, which defaults to print a traceback and ignoring the exception.
:param last_pin: The latest message that was pinned as an aware datetime in UTC. Could be ``None``.
:type last_pin: Optional[:class:`datetime.datetime`]
+.. function:: on_thread_join(thread)
+
+ Called whenever a thread is joined.
+
+ Note that you can get the guild from :attr:`Thread.guild`.
+
+ This requires :attr:`Intents.guilds` to be enabled.
+
+ .. versionadded:: 2.0
+
+ :param thread: The thread that got joined.
+ :type thread: :class:`Thread`
+
+.. function:: on_thread_remove(thread)
+
+ Called whenever a thread is removed. This is different from a thread being deleted.
+
+ Note that you can get the guild from :attr:`Thread.guild`.
+
+ This requires :attr:`Intents.guilds` to be enabled.
+
+ .. warning::
+
+ Due to technical limitations, this event might not be called
+ as soon as one expects. Since the library tracks thread membership
+ locally, the API only sends updated thread membership status upon being
+ synced by joining a thread.
+
+ .. versionadded:: 2.0
+
+ :param thread: The thread that got removed.
+ :type thread: :class:`Thread`
+
.. function:: on_thread_delete(thread)
- on_thread_create(thread)
- Called whenever a thread is deleted or created.
+ Called whenever a thread is deleted.
Note that you can get the guild from :attr:`Thread.guild`.
@@ -669,9 +701,21 @@ to handle it, which defaults to print a traceback and ignoring the exception.
.. versionadded:: 2.0
- :param thread: The thread that got created or deleted.
+ :param thread: The thread that got deleted.
:type thread: :class:`Thread`
+.. function:: on_thread_member_join(member)
+ on_thread_member_remove(member)
+
+ Called when a :class:`ThreadMember` leaves or joins a :class:`Thread`.
+
+ You can get the thread a member belongs in by accessing :attr:`ThreadMember.thread`.
+
+ This requires :attr:`Intents.members` to be enabled.
+
+ :param member: The member who joined or left.
+ :type member: :class:`ThreadMember`
+
.. function:: on_thread_update(before, after)
Called whenever a thread is updated.