|
|
@ -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'<FriendSuggestionReason platform={self.platform!r} name={self.name!r}>' |
|
|
|