|
78 | 78 | buttons: list[dict] |
79 | 79 | label: str (max: 32) |
80 | 80 | url: str (max: 512) |
| 81 | +NOTE: Bots cannot access a user's activity button URLs. When received through the |
| 82 | +gateway, the type of the buttons field will be list[str]. |
81 | 83 |
|
82 | 84 | There are also activity flags which are mostly uninteresting for the library atm. |
83 | 85 |
|
@@ -186,13 +188,18 @@ class Activity(BaseActivity): |
186 | 188 |
|
187 | 189 | - ``id``: A string representing the party ID. |
188 | 190 | - ``size``: A list of up to two integer elements denoting (current_size, maximum_size). |
189 | | - buttons: List[:class:`dict`] |
190 | | - An list of dictionaries representing custom buttons shown in a rich presence. |
| 191 | + buttons: Union[List[:class:`dict`], List[:class:`str`]] |
| 192 | + A list of dictionaries representing custom buttons shown in a rich presence. |
191 | 193 | Each dictionary contains the following keys: |
192 | 194 |
|
193 | 195 | - ``label``: A string representing the text shown on the button. |
194 | 196 | - ``url``: A string representing the URL opened upon clicking the button. |
195 | 197 |
|
| 198 | + .. note:: |
| 199 | +
|
| 200 | + Bots cannot access a user's activity button URLs. Therefore the type of this attribute |
| 201 | + will be List[:class:`str`] when received through the gateway. |
| 202 | +
|
196 | 203 | .. versionadded:: 2.0 |
197 | 204 |
|
198 | 205 | emoji: Optional[:class:`PartialEmoji`] |
@@ -230,7 +237,7 @@ def __init__(self, **kwargs): |
230 | 237 | self.flags: int = kwargs.pop("flags", 0) |
231 | 238 | self.sync_id: Optional[str] = kwargs.pop("sync_id", None) |
232 | 239 | self.session_id: Optional[str] = kwargs.pop("session_id", None) |
233 | | - self.buttons: List[ActivityButton] = kwargs.pop("buttons", []) |
| 240 | + self.buttons: List[str] = kwargs.pop("buttons", []) |
234 | 241 |
|
235 | 242 | activity_type = kwargs.pop("type", -1) |
236 | 243 | self.type: ActivityType = ( |
|
0 commit comments