-
-
Notifications
You must be signed in to change notification settings - Fork 477
docs: Improve docstrings and attribute documentation #2754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
426bb6a
6e68b7a
46aa608
332e652
eff4e52
477407f
e717f67
13c6037
c4b7091
1d7eb3f
dd0f397
340cec3
bc2fef9
d8b79ff
952aab8
7dd8a7a
0035a73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1130,6 +1130,8 @@ async def create_text_channel( | |
slowmode_delay: int = MISSING, | ||
nsfw: bool = MISSING, | ||
overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, | ||
default_thread_slowmode_delay: int | None = MISSING, | ||
default_auto_archive_duration: int = MISSING, | ||
) -> TextChannel: | ||
"""|coro| | ||
|
||
|
@@ -1172,6 +1174,16 @@ async def create_text_channel( | |
reason: Optional[:class:`str`] | ||
The reason for creating this channel. Shows up on the audit log. | ||
|
||
default_thread_slowmode_delay: Optional[:class:`int`] | ||
The initial slowmode delay to set on newly created threads in this channel. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
default_auto_archive_duration: :class:`int` | ||
The default auto archive duration in minutes for threads created in this channel. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
Returns | ||
------- | ||
:class:`TextChannel` | ||
|
@@ -1220,6 +1232,12 @@ async def create_text_channel( | |
if nsfw is not MISSING: | ||
options["nsfw"] = nsfw | ||
|
||
if default_thread_slowmode_delay is not MISSING: | ||
options["default_thread_slowmode_delay"] = default_thread_slowmode_delay | ||
|
||
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, | ||
|
@@ -1246,6 +1264,8 @@ async def create_voice_channel( | |
rtc_region: VoiceRegion | None = MISSING, | ||
video_quality_mode: VideoQualityMode = MISSING, | ||
overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, | ||
slowmode_delay: int = MISSING, | ||
nsfw: bool = MISSING, | ||
) -> VoiceChannel: | ||
"""|coro| | ||
|
||
|
@@ -1280,6 +1300,17 @@ async def create_voice_channel( | |
reason: Optional[:class:`str`] | ||
The reason for creating this channel. Shows up on the audit log. | ||
|
||
slowmode_delay: :class:`int` | ||
Specifies the slowmode rate limit for user in this channel, in seconds. | ||
The maximum value possible is `21600`. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
nsfw: :class:`bool` | ||
To mark the channel as NSFW or not. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
Returns | ||
------- | ||
:class:`VoiceChannel` | ||
|
@@ -1310,6 +1341,12 @@ async def create_voice_channel( | |
if video_quality_mode is not MISSING: | ||
options["video_quality_mode"] = video_quality_mode.value | ||
|
||
if slowmode_delay is not MISSING: | ||
options["rate_limit_per_user"] = slowmode_delay | ||
|
||
if nsfw is not MISSING: | ||
options["nsfw"] = nsfw | ||
|
||
data = await self._create_channel( | ||
name, | ||
overwrites=overwrites, | ||
|
@@ -1333,6 +1370,12 @@ async def create_stage_channel( | |
overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, | ||
category: CategoryChannel | None = None, | ||
reason: str | None = None, | ||
bitrate: int = MISSING, | ||
user_limit: int = MISSING, | ||
rtc_region: VoiceRegion | None = MISSING, | ||
video_quality_mode: VideoQualityMode = MISSING, | ||
slowmode_delay: int = MISSING, | ||
nsfw: bool = MISSING, | ||
) -> StageChannel: | ||
"""|coro| | ||
|
||
|
@@ -1358,6 +1401,38 @@ async def create_stage_channel( | |
reason: Optional[:class:`str`] | ||
The reason for creating this channel. Shows up on the audit log. | ||
|
||
bitrate: :class:`int` | ||
The channel's preferred audio bitrate in bits per second. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
user_limit: :class:`int` | ||
The channel's limit for number of members that can be in a voice channel. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
rtc_region: Optional[:class:`VoiceRegion`] | ||
The region for the voice channel's voice communication. | ||
A value of ``None`` indicates automatic voice region detection. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
video_quality_mode: :class:`VideoQualityMode` | ||
The camera video quality for the voice channel's participants. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
slowmode_delay: :class:`int` | ||
Specifies the slowmode rate limit for user in this channel, in seconds. | ||
The maximum value possible is `21600`. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
nsfw: :class:`bool` | ||
To mark the channel as NSFW or not. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
Returns | ||
------- | ||
:class:`StageChannel` | ||
|
@@ -1379,6 +1454,24 @@ async def create_stage_channel( | |
if position is not MISSING: | ||
options["position"] = position | ||
|
||
if bitrate is not MISSING: | ||
options["bitrate"] = bitrate | ||
|
||
if user_limit is not MISSING: | ||
options["user_limit"] = user_limit | ||
|
||
if rtc_region is not MISSING: | ||
options["rtc_region"] = None if rtc_region is None else str(rtc_region) | ||
|
||
if video_quality_mode is not MISSING: | ||
options["video_quality_mode"] = video_quality_mode.value | ||
|
||
if slowmode_delay is not MISSING: | ||
options["rate_limit_per_user"] = slowmode_delay | ||
|
||
if nsfw is not MISSING: | ||
options["nsfw"] = nsfw | ||
|
||
data = await self._create_channel( | ||
name, | ||
overwrites=overwrites, | ||
|
@@ -1405,6 +1498,10 @@ async def create_forum_channel( | |
nsfw: bool = MISSING, | ||
overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, | ||
default_reaction_emoji: GuildEmoji | int | str = MISSING, | ||
available_tags: list[ForumTag] = MISSING, | ||
default_sort_order: SortOrder | None = MISSING, | ||
default_thread_slowmode_delay: int | None = MISSING, | ||
default_auto_archive_duration: int = MISSING, | ||
) -> ForumChannel: | ||
"""|coro| | ||
|
||
|
@@ -1453,6 +1550,26 @@ async def create_forum_channel( | |
|
||
.. versionadded:: v2.5 | ||
|
||
available_tags: List[:class:`ForumTag`] | ||
The set of tags that can be used in a forum channel. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
default_sort_order: Optional[:class:`SortOrder`] | ||
The default sort order type used to order posts in this channel. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
default_thread_slowmode_delay: Optional[:class:`int`] | ||
The initial slowmode delay to set on newly created threads in this channel. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
default_auto_archive_duration: :class:`int` | ||
The default auto archive duration in minutes for threads created in this channel. | ||
|
||
.. versionadded:: 2.7 | ||
|
||
Returns | ||
------- | ||
:class:`ForumChannel` | ||
|
@@ -1501,6 +1618,20 @@ async def create_forum_channel( | |
if nsfw is not MISSING: | ||
options["nsfw"] = nsfw | ||
|
||
if available_tags is not MISSING: | ||
options["available_tags"] = [tag.to_dict() for tag in available_tags] | ||
|
||
if default_sort_order is not MISSING: | ||
options["default_sort_order"] = ( | ||
default_sort_order.value if default_sort_order else None | ||
) | ||
|
||
if default_thread_slowmode_delay is not MISSING: | ||
options["default_thread_slowmode_delay"] = default_thread_slowmode_delay | ||
|
||
if default_auto_archive_duration is not MISSING: | ||
options["default_auto_archive_duration"] = default_auto_archive_duration | ||
|
||
if default_reaction_emoji is not MISSING: | ||
if isinstance( | ||
default_reaction_emoji, _EmojiTag | ||
|
@@ -1542,6 +1673,7 @@ async def create_category( | |
overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, | ||
reason: str | None = None, | ||
position: int = MISSING, | ||
nsfw: bool = MISSING, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens really when a category is nsfw ? Is that inherited to the category's channels ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no idea, i guess yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Lumabots see above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even if i dont think it change anything so i'll remove it |
||
) -> CategoryChannel: | ||
"""|coro| | ||
|
||
|
@@ -1570,6 +1702,9 @@ async def create_category( | |
if position is not MISSING: | ||
options["position"] = position | ||
|
||
if nsfw is not MISSING: | ||
options["nsfw"] = nsfw | ||
|
||
data = await self._create_channel( | ||
name, | ||
overwrites=overwrites, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the nsfw docs, i copy them from their class to keep them similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but here it's not for editing the channel it's an attribute