> For the complete documentation index, see [llms.txt](https://seanime.gitbook.io/seanime-extensions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seanime.gitbook.io/seanime-extensions/plugins/ui/other/discord.md).

# Discord

## Permissions

{% hint style="warning" %}
`discord` permission is required
{% endhint %}

<pre class="language-json"><code class="lang-json">{
  //...
  "plugin": {
    "permissions": {
<strong>      "scopes": ["discord"]
</strong>    }
  }
}
</code></pre>

## ctx.discord

The `ctx.discord` API allows your plugin to integrate with Discord Rich Presence, displaying what users are watching or reading in their Discord status.

## Core Methods

### setAnimeActivity

Sets Discord Rich Presence to show anime activity.

**Parameters:**

* `opts`: Object containing:
  * `id`: Number - AniList media ID
  * `title`: String - Anime title to display
  * `image`: String - Image URL for the anime
  * `isMovie`: Boolean - Whether the anime is a movie
  * `episodeNumber`: Number - Current episode number
  * `progress` : Number - Progress in seconds
  * `duration` : Number - Duration in seconds
  * `totalEpisodes?` : Number - Number of episodes of the anime
  * `currentEpisodeCount?` : Number - Number of playable episodes
  * `episodeTitle?` : String - Episode title

### updateAnimeActivity

Update the current anime activity progress set by `setAnimeActivity` .

This is safe to call every second, Seanime will take care of batching updates

**Parameters**:

* `progress` : Number - Progress in seconds
* `duration` : Number - Duration in seconds
* `paused` : Boolean

### setMangaActivity

Sets Discord Rich Presence to show manga reading activity.

**Parameters:**

* `opts`: Object containing:
  * `id`: Number - AniList media ID
  * `title`: String - Manga title to display
  * `image`: String - Image URL for the manga
  * `chapter`: String - Current chapter number or range

### cancel

The `cancel()` function terminates any ongoing Discord Rich Presence activity.
