diff options
| author | Rapptz <[email protected]> | 2021-08-02 04:36:02 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-08-02 04:36:02 -0400 |
| commit | 58ca9e99325ac2678a51cd63afd7ae917f14bc8d (patch) | |
| tree | da59a6132e4cfef1b80bdf40215f313530828b0a /discord/channel.py | |
| parent | Fallback to None message_id searches in View dispatch (diff) | |
| download | discord.py-58ca9e99325ac2678a51cd63afd7ae917f14bc8d.tar.xz discord.py-58ca9e99325ac2678a51cd63afd7ae917f14bc8d.zip | |
Add TextChannel.default_auto_archive_duration
Diffstat (limited to 'discord/channel.py')
| -rw-r--r-- | discord/channel.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/discord/channel.py b/discord/channel.py index 05e9c55c..21b87c1b 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -127,6 +127,10 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): .. note:: To check if the channel or the guild of that channel are marked as NSFW, consider :meth:`is_nsfw` instead. + default_auto_archive_duration: :class:`int` + The default auto archive duration in minutes for threads created in this channel. + + .. versionadded:: 2.0 """ __slots__ = ( @@ -142,6 +146,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): '_overwrites', '_type', 'last_message_id', + 'default_auto_archive_duration', ) def __init__(self, *, state: ConnectionState, guild: Guild, data: TextChannelPayload): @@ -171,6 +176,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): self.nsfw: bool = data.get('nsfw', False) # Does this need coercion into `int`? No idea yet. self.slowmode_delay: int = data.get('rate_limit_per_user', 0) + self.default_auto_archive_duration: ThreadArchiveDuration = data.get('default_auto_archive_duration', 1440) self._type: int = data.get('type', self._type) self.last_message_id: Optional[int] = utils._get_as_snowflake(data, 'last_message_id') self._fill_overwrites(data) @@ -250,6 +256,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): sync_permissions: bool = ..., category: Optional[CategoryChannel] = ..., slowmode_delay: int = ..., + default_auto_archive_duration: ThreadArchiveDuration = ..., type: ChannelType = ..., overwrites: Mapping[Union[Role, Member, Snowflake], PermissionOverwrite] = ..., ) -> None: @@ -301,6 +308,9 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): overwrites: :class:`Mapping` A :class:`Mapping` of target (either a role or a member) to :class:`PermissionOverwrite` to apply to the channel. + default_auto_archive_duration: :class:`int` + The new default auto archive duration in minutes for threads created in this channel. + Must be one of ``60``, ``1440``, ``4320``, or ``10080``. Raises ------ |