mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
Fix activity button type
This commit is contained in:
parent
5fcd4e411f
commit
69595b5826
@ -74,9 +74,7 @@ type: int
|
|||||||
sync_id: str
|
sync_id: str
|
||||||
session_id: str
|
session_id: str
|
||||||
flags: int
|
flags: int
|
||||||
buttons: list[dict]
|
buttons: list[str (max: 32)]
|
||||||
label: str (max: 32)
|
|
||||||
url: str (max: 512)
|
|
||||||
|
|
||||||
There are also activity flags which are mostly uninteresting for the library atm.
|
There are also activity flags which are mostly uninteresting for the library atm.
|
||||||
|
|
||||||
@ -96,7 +94,6 @@ if TYPE_CHECKING:
|
|||||||
ActivityTimestamps,
|
ActivityTimestamps,
|
||||||
ActivityParty,
|
ActivityParty,
|
||||||
ActivityAssets,
|
ActivityAssets,
|
||||||
ActivityButton,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from .state import ConnectionState
|
from .state import ConnectionState
|
||||||
@ -187,12 +184,8 @@ class Activity(BaseActivity):
|
|||||||
|
|
||||||
- ``id``: A string representing the party ID.
|
- ``id``: A string representing the party ID.
|
||||||
- ``size``: A list of up to two integer elements denoting (current_size, maximum_size).
|
- ``size``: A list of up to two integer elements denoting (current_size, maximum_size).
|
||||||
buttons: List[:class:`dict`]
|
buttons: List[:class:`str`]
|
||||||
An list of dictionaries representing custom buttons shown in a rich presence.
|
An list of strings representing the labels of custom buttons shown in a rich presence.
|
||||||
Each dictionary contains the following keys:
|
|
||||||
|
|
||||||
- ``label``: A string representing the text shown on the button.
|
|
||||||
- ``url``: A string representing the URL opened upon clicking the button.
|
|
||||||
|
|
||||||
.. versionadded:: 2.0
|
.. versionadded:: 2.0
|
||||||
|
|
||||||
@ -231,7 +224,7 @@ class Activity(BaseActivity):
|
|||||||
self.flags: int = kwargs.pop('flags', 0)
|
self.flags: int = kwargs.pop('flags', 0)
|
||||||
self.sync_id: Optional[str] = kwargs.pop('sync_id', None)
|
self.sync_id: Optional[str] = kwargs.pop('sync_id', None)
|
||||||
self.session_id: Optional[str] = kwargs.pop('session_id', None)
|
self.session_id: Optional[str] = kwargs.pop('session_id', None)
|
||||||
self.buttons: List[ActivityButton] = kwargs.pop('buttons', [])
|
self.buttons: List[str] = kwargs.pop('buttons', [])
|
||||||
|
|
||||||
activity_type = kwargs.pop('type', -1)
|
activity_type = kwargs.pop('type', -1)
|
||||||
self.type: ActivityType = (
|
self.type: ActivityType = (
|
||||||
|
@ -76,11 +76,6 @@ class ActivityEmoji(TypedDict):
|
|||||||
animated: NotRequired[bool]
|
animated: NotRequired[bool]
|
||||||
|
|
||||||
|
|
||||||
class ActivityButton(TypedDict):
|
|
||||||
label: str
|
|
||||||
url: str
|
|
||||||
|
|
||||||
|
|
||||||
ActivityType = Literal[0, 1, 2, 4, 5]
|
ActivityType = Literal[0, 1, 2, 4, 5]
|
||||||
|
|
||||||
|
|
||||||
@ -106,5 +101,5 @@ class Activity(_BaseActivity, total=False):
|
|||||||
secrets: ActivitySecrets
|
secrets: ActivitySecrets
|
||||||
session_id: Optional[str]
|
session_id: Optional[str]
|
||||||
instance: bool
|
instance: bool
|
||||||
buttons: List[ActivityButton]
|
buttons: List[str]
|
||||||
sync_id: str
|
sync_id: str
|
||||||
|
Loading…
x
Reference in New Issue
Block a user