From ec803e5ff52c5a50afc6d4b74cc91c74f6a0015f Mon Sep 17 00:00:00 2001 From: Sivert Date: Wed, 30 Sep 2026 00:46:46 +0200 Subject: [PATCH] Addon API reference: media and activity (GRYT-1637) Generated from client#746, which adds the media and activity permissions and the calls behind them. Co-Authored-By: Claude Opus 5.5 --- content/docs/build/addon-api.mdx | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/content/docs/build/addon-api.mdx b/content/docs/build/addon-api.mdx index e2af42a..b5e5bdf 100644 --- a/content/docs/build/addon-api.mdx +++ b/content/docs/build/addon-api.mdx @@ -49,6 +49,8 @@ says which is missing. | `messaging` | Exchange its own messages with the servers you are on | | `display` | Show its own panel beside the member list | | `processes` | See which of your listed programs are running | +| `media` | See what your computer's media controls say is playing | +| `activity` | Put a card on your profile, like "Listening to", on every server you are on | ## The manifest @@ -154,6 +156,48 @@ on(handler: (running: string[]) => void): () => void Hear when that answer changes. Needs `processes`. +### `gryt.media` + +#### `current()` + +```ts +current(): Promise +``` + +Needs `media`. + +What the media controls say is playing, or null. Desktop only. + +#### `on()` + +```ts +on(handler: (playing: unknown) => void): () => void +``` + +Hear when it changes, checked every fifteen seconds. Needs `media`. + +### `gryt.activity` + +#### `set()` + +```ts +set(card: { type?: string; name: string; details?: string; state?: string; startedAt?: number }): Promise +``` + +Needs `activity`. + +Put a card on your profile: `{ type: "listening", name, details, state, startedAt }`. + +#### `clear()` + +```ts +clear(): Promise +``` + +Needs `activity`. + +Take the card down. + ### `gryt.ui` #### `panel()`