|
|
@ -1560,6 +1560,7 @@ class Guild(Hashable): |
|
|
|
rtc_region: Optional[str] = MISSING, |
|
|
|
video_quality_mode: VideoQualityMode = MISSING, |
|
|
|
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING, |
|
|
|
nsfw: bool = MISSING, |
|
|
|
) -> VoiceChannel: |
|
|
|
"""|coro| |
|
|
|
|
|
|
@ -1597,6 +1598,10 @@ class Guild(Hashable): |
|
|
|
The camera video quality for the voice channel's participants. |
|
|
|
|
|
|
|
.. versionadded:: 2.0 |
|
|
|
nsfw: :class:`bool` |
|
|
|
To mark the channel as NSFW or not. |
|
|
|
|
|
|
|
.. versionadded:: 2.6 |
|
|
|
reason: Optional[:class:`str`] |
|
|
|
The reason for creating this channel. Shows up on the audit log. |
|
|
|
|
|
|
@ -1632,6 +1637,9 @@ class Guild(Hashable): |
|
|
|
raise TypeError('video_quality_mode must be of type VideoQualityMode') |
|
|
|
options['video_quality_mode'] = video_quality_mode.value |
|
|
|
|
|
|
|
if nsfw is not MISSING: |
|
|
|
options['nsfw'] = nsfw |
|
|
|
|
|
|
|
data = await self._create_channel( |
|
|
|
name, overwrites=overwrites, channel_type=ChannelType.voice, category=category, reason=reason, **options |
|
|
|
) |
|
|
@ -1653,6 +1661,7 @@ class Guild(Hashable): |
|
|
|
rtc_region: Optional[str] = MISSING, |
|
|
|
video_quality_mode: VideoQualityMode = MISSING, |
|
|
|
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING, |
|
|
|
nsfw: bool = MISSING, |
|
|
|
) -> StageChannel: |
|
|
|
"""|coro| |
|
|
|
|
|
|
@ -1696,6 +1705,10 @@ class Guild(Hashable): |
|
|
|
The camera video quality for the voice channel's participants. |
|
|
|
|
|
|
|
.. versionadded:: 2.2 |
|
|
|
nsfw: :class:`bool` |
|
|
|
To mark the channel as NSFW or not. |
|
|
|
|
|
|
|
.. versionadded:: 2.6 |
|
|
|
reason: Optional[:class:`str`] |
|
|
|
The reason for creating this channel. Shows up on the audit log. |
|
|
|
|
|
|
@ -1732,6 +1745,9 @@ class Guild(Hashable): |
|
|
|
raise TypeError('video_quality_mode must be of type VideoQualityMode') |
|
|
|
options['video_quality_mode'] = video_quality_mode.value |
|
|
|
|
|
|
|
if nsfw is not MISSING: |
|
|
|
options['nsfw'] = nsfw |
|
|
|
|
|
|
|
data = await self._create_channel( |
|
|
|
name, overwrites=overwrites, channel_type=ChannelType.stage_voice, category=category, reason=reason, **options |
|
|
|
) |
|
|
@ -1800,6 +1816,7 @@ class Guild(Hashable): |
|
|
|
category: Optional[CategoryChannel] = None, |
|
|
|
slowmode_delay: int = MISSING, |
|
|
|
nsfw: bool = MISSING, |
|
|
|
media: bool = MISSING, |
|
|
|
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING, |
|
|
|
reason: Optional[str] = None, |
|
|
|
default_auto_archive_duration: int = MISSING, |
|
|
@ -1862,12 +1879,17 @@ class Guild(Hashable): |
|
|
|
.. versionadded:: 2.3 |
|
|
|
default_layout: :class:`ForumLayoutType` |
|
|
|
The default layout for posts in this forum. |
|
|
|
This cannot be set if ``media`` is set to ``True``. |
|
|
|
|
|
|
|
.. versionadded:: 2.3 |
|
|
|
available_tags: Sequence[:class:`ForumTag`] |
|
|
|
The available tags for this forum channel. |
|
|
|
|
|
|
|
.. versionadded:: 2.1 |
|
|
|
media: :class:`bool` |
|
|
|
Whether to create a media forum channel. |
|
|
|
|
|
|
|
.. versionadded:: 2.6 |
|
|
|
|
|
|
|
Raises |
|
|
|
------- |
|
|
@ -1919,7 +1941,7 @@ class Guild(Hashable): |
|
|
|
else: |
|
|
|
raise ValueError(f'default_reaction_emoji parameter must be either Emoji, PartialEmoji, or str') |
|
|
|
|
|
|
|
if default_layout is not MISSING: |
|
|
|
if not media and default_layout is not MISSING: |
|
|
|
if not isinstance(default_layout, ForumLayoutType): |
|
|
|
raise TypeError( |
|
|
|
f'default_layout parameter must be a ForumLayoutType not {default_layout.__class__.__name__}' |
|
|
@ -1931,10 +1953,17 @@ class Guild(Hashable): |
|
|
|
options['available_tags'] = [t.to_dict() for t in available_tags] |
|
|
|
|
|
|
|
data = await self._create_channel( |
|
|
|
name=name, overwrites=overwrites, channel_type=ChannelType.forum, category=category, reason=reason, **options |
|
|
|
name=name, |
|
|
|
overwrites=overwrites, |
|
|
|
channel_type=ChannelType.forum if not media else ChannelType.media, |
|
|
|
category=category, |
|
|
|
reason=reason, |
|
|
|
**options, |
|
|
|
) |
|
|
|
|
|
|
|
channel = ForumChannel(state=self._state, guild=self, data=data) |
|
|
|
channel = ForumChannel( |
|
|
|
state=self._state, guild=self, data=data # pyright: ignore[reportArgumentType] # it's the correct data |
|
|
|
) |
|
|
|
|
|
|
|
# temporarily add to the cache |
|
|
|
self._channels[channel.id] = channel |
|
|
@ -2921,6 +2950,11 @@ class Guild(Hashable): |
|
|
|
The name of the template. |
|
|
|
description: :class:`str` |
|
|
|
The description of the template. |
|
|
|
|
|
|
|
Returns |
|
|
|
-------- |
|
|
|
:class:`Template` |
|
|
|
The created template. |
|
|
|
""" |
|
|
|
from .template import Template |
|
|
|
|
|
|
|