mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-16 06:03:11 +00:00
Add support for archive duration in Guild.create_text_channel
This commit is contained in:
parent
5892bbd8b4
commit
6265723a35
@ -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
|
||||
)
|
||||
|
@ -922,7 +922,7 @@ class HTTPClient:
|
||||
'rate_limit_per_user',
|
||||
'rtc_region',
|
||||
'video_quality_mode',
|
||||
'auto_archive_duration',
|
||||
'default_auto_archive_duration',
|
||||
)
|
||||
payload.update({k: v for k, v in options.items() if k in valid_keys and v is not None})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user