diff --git a/discord/enums.py b/discord/enums.py index 5f161c14a..7b0dc2239 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -439,7 +439,7 @@ class RelationshipType(Enum): incoming_request = 3 outgoing_request = 4 implicit = 5 - suggestion = 6 + suggestion = 6 # Unused class NotificationLevel(Enum, comparable=True): diff --git a/discord/relationship.py b/discord/relationship.py index 5224e51bf..ffee73230 100644 --- a/discord/relationship.py +++ b/discord/relationship.py @@ -338,18 +338,18 @@ class FriendSuggestionReason: ----------- platform: :class:`ConnectionType` The platform the user was suggested from. - name: :class:`str` + name: Optional[:class:`str`] The user's name on the platform. """ __slots__ = ('type', 'platform', 'name') def __init__(self, data: FriendSuggestionReasonPayload): - # This entire model is unused by any client, so I have no idea what the type is + # This entire model is mostly unused by any client, so I have no idea what the type is # Also because of this, I'm treating everything as optional just in case self.type: int = data.get('type', 0) - self.platform: ConnectionType = try_enum(ConnectionType, data.get('platform', 'contacts')) - self.name: str = data.get('name', '') + self.platform: ConnectionType = try_enum(ConnectionType, data.get('platform')) + self.name: Optional[str] = data.get('name') def __repr__(self) -> str: return f'' diff --git a/discord/types/user.py b/discord/types/user.py index 0e979a8e5..a69096752 100644 --- a/discord/types/user.py +++ b/discord/types/user.py @@ -159,7 +159,7 @@ class Note(TypedDict): class FriendSuggestionReason(TypedDict): - name: str + name: Optional[str] platform_type: ConnectionType type: int