Add total_message_sent attribute to threads

Co-authored-by: Alex Nørgaard <Umbra@AbstractUmbra.dev>
Co-authored-by: dolfies <jeyalfie47@gmail.com>
This commit is contained in:
Sacul
2025-08-15 23:38:56 +08:00
committed by GitHub
parent 08ef967371
commit 7e2ca02fd1
5 changed files with 15 additions and 0 deletions

View File

@ -109,6 +109,10 @@ class Thread(Messageable, Hashable):
An approximate number of messages in this thread.
member_count: :class:`int`
An approximate number of members in this thread. This caps at 50.
total_message_sent: :class:`int`
The total number of messages sent, including deleted messages.
.. versionadded:: 2.6
me: Optional[:class:`ThreadMember`]
A thread member representing yourself, if you've joined the thread.
This could not be available.
@ -152,6 +156,7 @@ class Thread(Messageable, Hashable):
'archiver_id',
'auto_archive_duration',
'archive_timestamp',
'total_message_sent',
'_created_at',
'_flags',
'_applied_tags',
@ -185,6 +190,7 @@ class Thread(Messageable, Hashable):
self.slowmode_delay: int = data.get('rate_limit_per_user', 0)
self.message_count: int = data['message_count']
self.member_count: int = data['member_count']
self.total_message_sent: int = data.get('total_message_sent', 0)
self._flags: int = data.get('flags', 0)
# SnowflakeList is sorted, but this would not be proper for applied tags, where order actually matters.
self._applied_tags: array.array[int] = array.array('Q', map(int, data.get('applied_tags', [])))