📒
discord-super-utils
  • Introduction
  • Installation
  • Managers
    • Base
    • Leveling Manager
    • Database Manager
    • Music Manager
    • Page Manager
    • Reaction Manager
Powered by GitBook
On this page
  • ReactionManager
  • Attributes
  • Methods
  • Events

Was this helpful?

  1. Managers

Reaction Manager

This page shows you everything about ReactionManager.

PreviousPage Manager

Last updated 3 years ago

Was this helpful?

ReactionManager

class discordSuperUtils.ReactionManager(database, table, bot)

Initializer of , represents a reaction manager that manages reactions. Inherits .

All inherited methods and attributes from are unlisted.

database

format_data

on_reaction_event

table

checks

bot

create_reaction

delete_reaction

Attributes

  • database ()

    • The database the reaction manager will work on.

    • Passed in initializer.

  • table (str)

    • The database table the reaction manager will work on.

    • 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)

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

Events
ReactionManager
DatabaseManager
Attributes
Methods
EventManager
EventManager