feat: Remove PresenceButton object.
@@ -14,7 +14,6 @@ __all__ = (
"PresenceTimestamp",
"PresenceActivity",
"PresenceActivityType",
- "PresenceButtons",
"ClientPresence",
)
@@ -64,19 +63,6 @@ class PresenceSecrets(DictSerializerMixin):
match: Optional[str] = field(default=None)
-@define()
-class PresenceButtons(DictSerializerMixin):
- """
- A class object representing the buttons of a presence.
-
- :ivar str label: Text of the button
- :ivar str url: URL of the button
- """
-
- label: str = field()
- url: str = field()
-
-
@define()
class PresenceTimestamp(DictSerializerMixin):
"""
@@ -109,8 +95,11 @@ class PresenceActivity(DictSerializerMixin):
A class object representing the current activity data of a presence.
.. note::
- When using this model to instantiate alongside the client, if you provide a type 1 ( or PresenceActivityType.STREAMING ), then
- the ``url`` attribute is necessary.
+ When using this model to instantiate alongside the client, if you provide a type 1 ( or PresenceActivityType.STREAMING ),
+ then the ``url`` attribute is necessary.
+
+ The ``button`` attribute technically contains an object denoting Presence buttons. However, the gateway dispatches these
+ as strings (of button labels) as bots don't read the button URLs.
:ivar str name: The activity name
:ivar Union[int, PresenceActivityType] type: The activity type
@@ -126,7 +115,7 @@ class PresenceActivity(DictSerializerMixin):
:ivar Optional[PresenceSecrets] secrets?: for RPC join/spectate
:ivar Optional[bool] instance?: A status denoting if the activity is a game session
:ivar Optional[int] flags?: activity flags
- :ivar Optional[List[PresenceButtons]] buttons?: Custom buttons shown in the RPC.
+ :ivar Optional[List[str]] buttons?: Custom button labels shown in the status, if any.
"""
name: str = field()
@@ -143,9 +132,7 @@ class PresenceActivity(DictSerializerMixin):
secrets: Optional[PresenceSecrets] = field(converter=PresenceSecrets, default=None)
instance: Optional[bool] = field(default=None)
flags: Optional[int] = field(default=None)
- buttons: Optional[List[PresenceButtons]] = field(
- converter=convert_list(PresenceButtons), default=None
- )
+ buttons: Optional[List[str]] = field(default=None)
# TODO: document/investigate what these do.
user: Optional[Any] = field(default=None)
users: Optional[Any] = field(default=None)
