Skip to content

Commit 0c193b5

Browse files
docs: misc fixes/clarifications (#1052)
Co-authored-by: arl <me@arielle.codes>
1 parent 051a963 commit 0c193b5

File tree

5 files changed

+25
-36
lines changed

5 files changed

+25
-36
lines changed

changelog/635.feature.rst

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1 @@
1-
Clone more attributes in channel ``clone`` methods, and add them as keyword-only parameters to the the respective ``clone`` method on every :class:`abc.GuildChannel` subclass to make in-place edits. The clone methods now support the following fields:
2-
3-
- :class:`TextChannel`:
4-
The :meth:`TextChannel.clone` will now clone :attr:`TextChannel.name`, :attr:`TextChannel.topic`, :attr:`TextChannel.position`, :attr:`TextChannel.nsfw`,
5-
:attr:`TextChannel.category`, :attr:`TextChannel.slowmode_delay`, :attr:`TextChannel.type`, :attr:`TextChannel.default_auto_archive_duration`,
6-
:attr:`TextChannel.default_thread_slowmode_delay`, :attr:`TextChannel.overwrites` into the newly-cloned TextChannel.
7-
8-
- :class:`VoiceChannel`:
9-
The :meth:`VoiceChannel.clone` will now clone :attr:`VoiceChannel.name`, :attr:`VoiceChannel.bitrate`, :attr:`VoiceChannel.user_limit`, :attr:`VoiceChannel.position`, :attr:`VoiceChannel.category`,
10-
:attr:`VoiceChannel.rtc_region`, :attr:`VoiceChannel.video_quality_mode`, :attr:`VoiceChannel.nsfw`, :attr:`VoiceChannel.slowmode_delay`, :attr:`VoiceChannel.overwrites` into the newly-cloned VoiceChannel.
11-
12-
- :class:`CategoryChannel`:
13-
The :meth:`CategoryChannel.clone` will now clone :attr:`CategoryChannel.name`, :attr:`CategoryChannel.position`, :attr:`CategoryChannel.overwrites` into the newly-cloned CategoryChannel.
14-
15-
- :class:`StageChannel`:
16-
The :meth:`StageChannel.clone` will now clone :attr:`StageChannel.name`, :attr:`StageChannel.position`, :attr:`StageChannel.category`, :attr:`StageChannel.rtc_region`, :attr:`StageChannel.bitrate`,
17-
:attr:`StageChannel.nsfw`, :attr:`StageChannel.slowmode_delay`, :attr:`StageChannel.video_quality_mode` and :attr:`StageChannel.overwrites` into the newly-cloned StageChannel.
18-
19-
- :class:`ForumChannel`:
20-
The :meth:`ForumChannel.clone` will now clone :attr:`ForumChannel.name`, :attr:`ForumChannel.topic`, :attr:`ForumChannel.position`, :attr:`ForumChannel.nsfw`, :attr:`ForumChannel.category`,
21-
:attr:`ForumChannel.slowmode_delay`, :attr:`ForumChannel.default_auto_archive_duration`, :attr:`ForumChannel.default_thread_slowmode_delay`, :attr:`ForumChannel.available_tags`,
22-
:attr:`ForumChannel.default_reaction`, :attr:`ForumChannel.default_sort_order`, :attr:`ForumChannel.overwrites` into the newly-cloned ForumChannel.
1+
Clone more attributes in :meth:`TextChannel.clone`, :meth:`VoiceChannel.clone`, :meth:`StageChannel.clone`, :meth:`CategoryChannel.clone`, and :meth:`ForumChannel.clone`, and add them as keyword-only parameters to make in-place edits. See the specific ``clone`` method's documentation for details.

disnake/abc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,13 +1293,13 @@ async def create_invite(
12931293
Parameters
12941294
----------
12951295
max_age: :class:`int`
1296-
How long the invite should last in seconds. If it's 0 then the invite
1296+
How long the invite should last in seconds. If set to ``0``, then the invite
12971297
doesn't expire. Defaults to ``0``.
12981298
12991299
.. warning::
13001300
13011301
If the guild is not a Community guild (has ``COMMUNITY`` in :attr:`.Guild.features`),
1302-
this must be set to a time between ``1`` and ``2592000`` seconds.
1302+
this must be set to a number between ``1`` and ``2592000`` seconds.
13031303
13041304
max_uses: :class:`int`
13051305
How many uses the invite could be used for. If it's 0 then there
@@ -1317,13 +1317,13 @@ async def create_invite(
13171317
.. versionadded:: 2.0
13181318
13191319
target_user: Optional[:class:`User`]
1320-
The user whose stream to display for this invite, required if `target_type` is `TargetType.stream`.
1320+
The user whose stream to display for this invite, required if ``target_type`` is :attr:`.InviteTarget.stream`.
13211321
The user must be streaming in the channel.
13221322
13231323
.. versionadded:: 2.0
13241324
13251325
target_application: Optional[:class:`.Snowflake`]
1326-
The ID of the embedded application for the invite, required if `target_type` is `TargetType.embedded_application`.
1326+
The ID of the embedded application for the invite, required if ``target_type`` is :attr:`.InviteTarget.embedded_application`.
13271327
13281328
.. versionadded:: 2.0
13291329

disnake/channel.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ async def clone(
509509
510510
.. note::
511511
The current :attr:`TextChannel.flags` value won't be cloned.
512-
This is a discord limitation.
512+
This is a Discord limitation.
513513
514514
Parameters
515515
----------
@@ -1356,7 +1356,7 @@ async def clone(
13561356
13571357
.. note::
13581358
The current :attr:`VoiceChannel.flags` value won't be cloned.
1359-
This is a discord limitation.
1359+
This is a Discord limitation.
13601360
13611361
Parameters
13621362
----------
@@ -2058,7 +2058,7 @@ async def clone(
20582058
20592059
.. note::
20602060
The current :attr:`StageChannel.flags` value won't be cloned.
2061-
This is a discord limitation.
2061+
This is a Discord limitation.
20622062
20632063
.. warning::
20642064
Currently the ``user_limit`` attribute is not cloned due to a Discord limitation.
@@ -2807,7 +2807,7 @@ async def clone(
28072807
28082808
.. note::
28092809
The current :attr:`CategoryChannel.flags` value won't be cloned.
2810-
This is a discord limitation.
2810+
This is a Discord limitation.
28112811
28122812
Parameters
28132813
----------
@@ -3647,7 +3647,7 @@ async def clone(
36473647
36483648
.. note::
36493649
The current :attr:`ForumChannel.flags` value won't be cloned.
3650-
This is a discord limitation.
3650+
This is a Discord limitation.
36513651
36523652
Parameters
36533653
----------

disnake/client.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,9 @@ async def change_presence(
16731673
16741674
Changes the client's presence.
16751675
1676+
.. versionchanged:: 2.0
1677+
Removed the ``afk`` keyword-only parameter.
1678+
16761679
.. versionchanged:: 2.6
16771680
Raises :exc:`TypeError` instead of ``InvalidArgument``.
16781681
@@ -1684,9 +1687,6 @@ async def change_presence(
16841687
game = disnake.Game("with the API")
16851688
await client.change_presence(status=disnake.Status.idle, activity=game)
16861689
1687-
.. versionchanged:: 2.0
1688-
Removed the ``afk`` keyword-only parameter.
1689-
16901690
Parameters
16911691
----------
16921692
activity: Optional[:class:`.BaseActivity`]
@@ -1894,6 +1894,11 @@ async def create_guild(
18941894
18951895
Bot accounts in 10 or more guilds are not allowed to create guilds.
18961896
1897+
.. note::
1898+
1899+
Using this, you will **not** receive :attr:`.Guild.channels`, :attr:`.Guild.members`,
1900+
:attr:`.Member.activity` and :attr:`.Member.voice` per :class:`.Member`.
1901+
18971902
.. versionchanged:: 2.5
18981903
Removed the ``region`` parameter.
18991904
@@ -1951,6 +1956,11 @@ def guild_builder(self, name: str) -> GuildBuilder:
19511956
19521957
Bot accounts in 10 or more guilds are not allowed to create guilds.
19531958
1959+
.. note::
1960+
1961+
Using this, you will **not** receive :attr:`.Guild.channels`, :attr:`.Guild.members`,
1962+
:attr:`.Member.activity` and :attr:`.Member.voice` per :class:`.Member`.
1963+
19541964
.. versionadded:: 2.8
19551965
19561966
Parameters

docs/api/events.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ Members
764764
.. function:: on_member_join(member)
765765
on_member_remove(member)
766766

767-
Called when a :class:`Member` leaves or joins a :class:`Guild`.
767+
Called when a :class:`Member` joins or leaves a :class:`Guild` (this includes getting kicked/banned).
768768
If :func:`on_member_remove` is being used then consider using :func:`on_raw_member_remove` which will be called regardless of the cache.
769769

770770
This requires :attr:`Intents.members` to be enabled.
@@ -796,7 +796,7 @@ Members
796796

797797
.. function:: on_raw_member_remove(payload)
798798

799-
Called when a member leaves a :class:`Guild`.
799+
Called when a member leaves a :class:`Guild` (this includes getting kicked/banned).
800800
Unlike :func:`on_member_remove`, this is called regardless of the member cache.
801801

802802
.. versionadded:: 2.6

0 commit comments

Comments
 (0)