Skip to content

Fix documentation for User.display_name#10385

Open
IndorilReborn wants to merge 1 commit into
Rapptz:masterfrom
IndorilReborn:patch-1
Open

Fix documentation for User.display_name#10385
IndorilReborn wants to merge 1 commit into
Rapptz:masterfrom
IndorilReborn:patch-1

Conversation

@IndorilReborn
Copy link
Copy Markdown

Summary

The User.display_name docstring is a copy of Member.display_name one, but it does not actually try to fetch a guild-specific display_name
https://github.com/Rapptz/discord.py/blob/master/discord/user.py#L313

    @property
    def display_name(self) -> str:
        """:class:`str`: Returns the user's display name.

        For regular users this is just their global name or their username,
        but if they have a guild specific nickname then that
        is returned instead.
        """
        if self.global_name:
            return self.global_name
        return self.name

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • 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, ...)

@Rapptz
Copy link
Copy Markdown
Owner

Rapptz commented Jan 14, 2026

Not quite.

This is the BaseUser docstring which applies to all the BaseUser subclasses. Some of these are also Member-like (e.g. WidgetMember) so the docstring is supposed to be correct there. That being said, it seems WidgetMember's implementation is bugged anyhow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants