mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-08-23 11:46:18 +00:00
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:
parent
08ef967371
commit
7e2ca02fd1
@ -790,6 +790,10 @@ class AppCommandThread(Hashable):
|
||||
member_count: :class:`int`
|
||||
An approximate number of members in this thread. This caps at 50.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
total_message_sent: :class:`int`
|
||||
The total number of messages sent, including deleted messages.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
permissions: :class:`~discord.Permissions`
|
||||
The resolved permissions of the user who invoked
|
||||
@ -830,6 +834,7 @@ class AppCommandThread(Hashable):
|
||||
'member_count',
|
||||
'slowmode_delay',
|
||||
'last_message_id',
|
||||
'total_message_sent',
|
||||
'_applied_tags',
|
||||
'_flags',
|
||||
'_created_at',
|
||||
@ -855,6 +860,7 @@ class AppCommandThread(Hashable):
|
||||
self.message_count: int = int(data['message_count'])
|
||||
self.last_message_id: Optional[int] = _get_as_snowflake(data, 'last_message_id')
|
||||
self.slowmode_delay: int = data.get('rate_limit_per_user', 0)
|
||||
self.total_message_sent: int = data.get('total_message_sent', 0)
|
||||
self._applied_tags: array.array[int] = array.array('Q', map(int, data.get('applied_tags', [])))
|
||||
self._flags: int = data.get('flags', 0)
|
||||
self._unroll_metadata(data['thread_metadata'])
|
||||
|
@ -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', [])))
|
||||
|
@ -126,6 +126,7 @@ class ThreadChannel(_BaseChannel):
|
||||
rate_limit_per_user: int
|
||||
message_count: int
|
||||
member_count: int
|
||||
total_message_sent: int
|
||||
thread_metadata: ThreadMetadata
|
||||
member: NotRequired[ThreadMember]
|
||||
owner_id: NotRequired[Snowflake]
|
||||
|
@ -85,6 +85,7 @@ class PartialThread(_BasePartialChannel):
|
||||
rate_limit_per_user: int
|
||||
last_message_id: NotRequired[Optional[Snowflake]]
|
||||
flags: NotRequired[int]
|
||||
total_message_sent: int
|
||||
|
||||
|
||||
class ResolvedData(TypedDict, total=False):
|
||||
|
@ -60,6 +60,7 @@ class Thread(TypedDict):
|
||||
type: ThreadType
|
||||
member_count: int
|
||||
message_count: int
|
||||
total_message_sent: int
|
||||
rate_limit_per_user: int
|
||||
thread_metadata: ThreadMetadata
|
||||
member: NotRequired[ThreadMember]
|
||||
|
Loading…
x
Reference in New Issue
Block a user