# Pagination

{% hint style="info" %}
Replace `[prefix]` with your server's prefix.
{% endhint %}

## Setup a Embed for Pagination

To setup a pagination embed, we need to create a normal embed via the bot first. We do this by running the command `[prefix]createembed [code]`

```
// Syntax
[prefix]createembed [code]

// Example
[prefix]createembed {embed}{description: test embed}
```

<figure><img src="/files/omMNeUBxuUe9oYO91cnJ" alt=""><figcaption></figcaption></figure>

### Set Embed as Pagination Embed

After we done this, we need to get the message url or the message id from the created embed. After we did this, we can run the following command, to set the recently created embed as a paginated one.

```
// Syntax
[prefix]pagination set [message id/message link]

// Example
[prefix]pagination set 1279146812875214929
```

<figure><img src="/files/k1JKBGSkGOyVkMTqEXEP" alt=""><figcaption></figcaption></figure>

If the command was successful, we can see two arrow reactions under the embed. Now that we've done that, we can add pages to the embed.

{% hint style="info" %}
If you do not add any footer to your embeds, the paginator will automatically set the footer to display the current page and highest page (e.g. Page 1 of 4)
{% endhint %}

### Adding Pages to the Embed

To add more Pages to the paginated embed, we need to create a new embed code for our second embed. You can do this by running `[prefix]embedsetup` and create one via discord, or you can use our online [embedbuilder](https://serenity.wtf/embed).

When this is done, we can start by running following command: `[prefix]pagination add`

```
// Syntax
[prefix]pagination add [message id/message link] [code]

// Example
[prefix]pagination add 1279146812875214929 {embed}{description: test embed no.2}
```

<figure><img src="/files/44s5T0JhfcV01kx6Xn13" alt=""><figcaption></figcaption></figure>

### Delete a Page from the Embed

If you wish to remove a page from your paginated embed. You can do this easily by running `[prefix]pagination remove`

{% hint style="info" %}
If you don't know the page number, you can switch between the pages of your paginated embed to see the page in the footer. Otherwise, the pages are listed in the order you've added them to the embed.
{% endhint %}

```
// Syntax
[prefix]pagination remove [message id/message link] [page]

// Example
[prefix]pagination update 1279146812875214929 2
```

<figure><img src="/files/eIYLtis2OWBnvtHrdFz6" alt=""><figcaption></figcaption></figure>

## Updating a Page in the Embed

You've got a typo in your embed script or want to change a specific page? No problem, you dont need to reset the whole embed to edit it. You only need to get the new embed code for the specific page you wanna change, and then need to run `[prefix]pagination update`

```
// Syntax
[prefix]pagination update [message id/message link] [page] [code]

// Example
[prefix]pagination update 1279146812875214929 2 {embed}{description: edited embed no.2}
```

<figure><img src="/files/7goktzbYYIMgfliWWtHC" alt=""><figcaption></figcaption></figure>

## Restore the Emoji Reactions

If the emoji reactions from the bot gets removed somehow from the embed, then you can add them back by running following command: `[prefix]pagination restorereactions`

```
// Syntax
[prefix]pagination restorereactions [message id/message link]

// Example
[prefix]pagination restorereactions 1279146812875214929
```

<figure><img src="/files/sYMXXMCJfisSP4HNADoi" alt=""><figcaption></figcaption></figure>

## Remove a Pagination Embed

To remove a pagination embed completely with pages and everything, you can do this by running the command: `[prefix]pagination delete`

```
// Syntax
[prefix]pagination delete [message id/message link]

// Example
[prefix]pagination delete 1279146812875214929
```

<figure><img src="/files/7Pcn3AgYd7HBbPszbcjU" alt=""><figcaption></figcaption></figure>

## Reset all Pagination Embeds

If you wish to disable the pagination module completely or just want to reset/remove all embeds with just one command, you can run: `[prefix]pagination reset`

<figure><img src="/files/OJ1x6z1TVfk2l1PPwimJ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.serenity.wtf/embeds/pagination.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
