Skip to content

docs: Improve docstrings and attribute documentation #2754

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Lumabots
Copy link

@Lumabots Lumabots commented Mar 29, 2025

Summary

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • [] This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
add missings docs

Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
@Lumabots Lumabots changed the title Fix Docstrings and Attribute docs: Improve docstrings and attribute documentation Mar 29, 2025
@Lumabots
Copy link
Author

checklist might not be accurate, i changed the code to add some missings parts but its mainly adding the missing docs + parameters inside the function definition

discord/guild.py Outdated
@@ -1542,6 +1673,7 @@ async def create_category(
overwrites: dict[Role | Member, PermissionOverwrite] = MISSING,
reason: str | None = None,
position: int = MISSING,
nsfw: bool = MISSING,
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea, i guess yes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lumabots see above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-04-10 at 10 52 54 @Paillat-dev @plun1331 since it return still an nsfw should i let it inside or not ?

Copy link
Author

Choose a reason for hiding this comment

The 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

@@ -1724,6 +1724,11 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
Extra features of the channel.

.. versionadded:: 2.0

nsfw: :class:`bool`
To mark the channel as NSFW or not.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To mark the channel as NSFW or not.
Whether the channel is marked as NSFW or not.

Copy link
Author

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

Copy link
Contributor

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

@Paillat-dev
Copy link
Contributor

Paillat-dev commented Mar 29, 2025

Also, I assume you tested each of the changes and they work. + Add the changelog

@Lumabots
Copy link
Author

Also, I assume you tested each of the changes and they work. + Add the changelog

nop i didnt test them yet, i will do that this afternoon, i also have to fix another issue before the "'ForumChannel' object has no attribute 'default_reaction_emoji'"

Lumabots and others added 5 commits March 29, 2025 17:06
Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
@Lumabots
Copy link
Author

i tested it everything works, so this add the missing docstring and parameters for the channels and add the possibility to create a channel with a default reaction as None (edit was already done by paillait)

Lumabots and others added 2 commits March 29, 2025 21:46
Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
Lumabots and others added 6 commits April 7, 2025 16:33
Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
removal of all the nsfw mention which should not exist for category

Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com>
@Lumabots
Copy link
Author

i removed all of the nsfw code related to category channel since even if its returned by discord its not posible to be other thing than false

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants