Browse Source

Small docstring fixes

pull/10109/head
dolfies 4 years ago
parent
commit
7bbc38f675
  1. 18
      discord/settings.py
  2. 3
      discord/user.py

18
discord/settings.py

@ -171,45 +171,43 @@ class UserSettings:
@property
def tracking(self) -> Optional[Tracking]:
"""Returns your tracking settings if available."""
"""Optional[:class:`Tracking`]: Returns your tracking settings if available."""
return self._state.consents
@property
def animate_stickers(self) -> StickerAnimationOptions:
"""Whether or not to animate stickers in the chat."""
""":class:`StickerAnimationOptions`: Whether or not to animate stickers in the chat."""
return try_enum(StickerAnimationOptions, self._animate_stickers)
@property
def explicit_content_filter(self) -> UserContentFilter:
"""The filter for explicit content in all messages."""
""":class:`UserContentFilter`: The filter for explicit content in all messages."""
return try_enum(UserContentFilter, self._explicit_content_filter)
@property
def friend_source_flags(self) -> FriendFlags:
"""Who can add you as a friend."""
""":class:`FriendFlags`: Who can add you as a friend."""
return FriendFlags._from_dict(self._friend_source_flags)
@property
def guild_folders(self) -> List[GuildFolder]:
"""A list of guild folders."""
"""List[:class:`GuildFolder`]: A list of guild folders."""
state = self._state
return [GuildFolder(data=folder, state=state) for folder in self._guild_folders]
@property
def guild_positions(self) -> List[Guild]:
"""A list of guilds in order of the guild/guild icons that are on
the left hand side of the UI.
"""
"""List[:class:`Guild`]: A list of guilds in order of the guild/guild icons that are on the left hand side of the UI."""
return list(filter(None, map(self._get_guild, self._guild_positions)))
@property
def restricted_guilds(self) -> List[Guild]:
"""A list of guilds that you will not receive DMs from."""
"""List[:class:`Guild`]: A list of guilds that you will not receive DMs from."""
return list(filter(None, map(self._get_guild, self._restricted_guilds)))
@property
def theme(self) -> Theme:
"""The theme of the Discord UI."""
""":class:`Theme`: The theme of the Discord UI."""
return try_enum(Theme, self._theme)
def _get_guild(self, id: int) -> Optional[Guild]:

3
discord/user.py

@ -635,7 +635,6 @@ class ClientUser(BaseUser):
def _update(self, data: UserPayload) -> None:
super()._update(data)
# There's actually an Optional[str] phone field as well but I won't use it
self.verified = data.get('verified', False)
self.email = data.get('email')
self.phone = _get_as_snowflake(data, 'phone')
@ -1015,7 +1014,7 @@ class User(BaseUser, discord.abc.Connectable, discord.abc.Messageable):
self._stored: bool = False
def __repr__(self) -> str:
return f'<User id={self.id} name={self.name!r} discriminator={self.discriminator!r} bot={self.bot}>'
return f'<User id={self.id} name={self.name!r} discriminator={self.discriminator!r} bot={self.bot} system={self.system}>'
def __del__(self) -> None:
try:

Loading…
Cancel
Save