Add support for archive duration in Guild.create_text_channel

This commit is contained in:
I. Ahmad
2022-04-12 02:21:08 +05:00
committed by GitHub
parent 5892bbd8b4
commit 6265723a35
2 changed files with 9 additions and 1 deletions

View File

@@ -1180,6 +1180,7 @@ class Guild(Hashable):
slowmode_delay: int = MISSING,
nsfw: bool = MISSING,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING,
default_auto_archive_duration: int = MISSING,
) -> TextChannel:
"""|coro|
@@ -1245,6 +1246,10 @@ class Guild(Hashable):
The maximum value possible is `21600`.
nsfw: :class:`bool`
To mark the channel as NSFW or not.
default_auto_archive_duration: :class:`int`
The default auto archive duration for threads created in the text channel (in minutes).
.. versionadded:: 2.0
reason: Optional[:class:`str`]
The reason for creating this channel. Shows up on the audit log.
@@ -1276,6 +1281,9 @@ class Guild(Hashable):
if nsfw is not MISSING:
options['nsfw'] = nsfw
if default_auto_archive_duration is not MISSING:
options["default_auto_archive_duration"] = default_auto_archive_duration
data = await self._create_channel(
name, overwrites=overwrites, channel_type=ChannelType.text, category=category, reason=reason, **options
)