> For the complete documentation index, see [llms.txt](https://discord-super-utils.gitbook.io/discord-super-utils/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://discord-super-utils.gitbook.io/discord-super-utils/managers/reaction-manager.md).

# Reaction Manager

This page shows you everything about ReactionManager.

## ReactionManager

#### **class discordSuperUtils.**&#x52;eactionManage&#x72;**(database, table, bot)**

Initializer of [**`ReactionManager`**](/discord-super-utils/managers/reaction-manager.md#reactionmanager), represents a reaction manager that manages reactions. Inherits [**`EventManager`**](/discord-super-utils/managers/base.md#eventmanager).

{% hint style="warning" %}
All inherited methods and attributes from[ **EventManager**](/discord-super-utils/managers/base.md#eventmanager) are unlisted.
{% endhint %}

| [**Attributes**](/discord-super-utils/managers/page-manager.md#attributes) | [**Methods**](/discord-super-utils/managers/page-manager.md#methods) | [**Events**](/discord-super-utils/managers/reaction-manager.md#events) |
| -------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| **`database`**                                                             | **`format_data`**                                                    | **`on_reaction_event`**                                                |
| **`table`**                                                                | **`checks`**                                                         |                                                                        |
| **`bot`**                                                                  | **`create_reaction`**                                                |                                                                        |
|                                                                            | **`delete_reaction`**                                                |                                                                        |

### Attributes

* **`database` (**[**DatabaseManager**](/discord-super-utils/managers/database-manager.md#databasemanager)**)**

  * The database the reaction manager will work on.&#x20;
  * Passed in initializer.

* **`table` (str)**

  * The database table the reaction manager will work on.&#x20;
  * Passed in initializer.

* **`bot` (commands.Bot)**
  * The bot that the reaction manager will work on.
  * Passed in initializer.

### Methods

* **`format_data()`**

  **Formats** **data** into an organized dict.\
  This function is a classmethod (static).\
  \
  **Parameters**

  * **`data` (list)**
    * &#x20;Data to format.

* **`checks(guild_id, message_id, emoji)`**\
  Returns a dictionary of **checks** that are used as database **checks**.\
  This function is a classmethod (static).\
  \
  **Parameters**
  * **`guild_id` (int)**
    * The value of the guild key.
  * **`message_id` (int)**
    * The value of the message key.
  * **`emoji` (str)**

    * The value of the emoji key.

* **`create_reaction(guild, message, role, emoji, remove_on_reaction)`**\
  Creates a reaction role and saves it in the database.\
  A record wont be created if a record with the same values already exists.\
  \
  **Parameters**

  * **`guild` (discord.Guild)**
    * The guild of the reaction role.
  * **`message` (discord.Message)**
    * The message of the reaction role.
  * **`role` (discord.Role)**

    * The role of the reaction role.
    * If `None`, calls on-reaction-event.

  **Raises**

  * **EmojiError**

    * Cannot add reaction to message.

* **`delete_reaction(guild, message, emoji)`**\
  **Deletes** a reaction role from the database.\
  \
  **Parameters**
  * **`guild` (discord.Guild)**
    * The guild of the reaction role.
  * **`message` (discord.Message)**
    * The message of the reaction role.
  * **`emoji` (str)**
    * The emoji of the reaction role.

### **Events**

* **`on_reaction_event(guild, channel, message, member, emoji)`**\
  This event is called if a **reaction role** is triggered but **role** is `None`.\
  \
  **Parameters**
  * **`guild` (discord.Guild)**
    * The guild of the reaction role.
  * **`channel` (discord.TextChannel)**
    * The channel of the reaction role.
  * **`message` (discord.Message)**
    * The message of the reaction role.
  * **`member` (discord.Member)**
    * The reaction member.
  * **`emoji` (str)**
    * The emoji of the reaction role.
