> 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://seanime.gitbook.io/seanime-extensions/plugins/ui/other/discord.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
