@hunteroi/discord-selfrole
    Preparing search index...

    Class ReactionsSelfRoleManager

    A class that manages self-assignable roles using reactions.

    Discord has encouraged people to use interactions instead of reactions. See InteractionsSelfRoleManager.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    channels: Collection<string, ChannelProperties>

    The collection of registered channels.

    SelfRoleManager#channels

    client: Client

    The client that instantiated this Manager

    SelfRoleManager#client

    The options of the manager.

    Methods

    • Returns the RTE (and its role) based on the emoji provided.

      Parameters

      • sender:
            | MessageReaction
            | PartialMessageReaction
            | StringSelectMenuInteraction<CacheType>
            | ButtonInteraction<CacheType>

        the button component or message reaction

      • channelOptions: ChannelOptions

        the channel options

      • Optionalemoji: null | GuildEmoji | ReactionEmoji | APIMessageComponentEmoji

        the emoji clicked

      Returns undefined | RoleToEmojiData | RoleToEmojiData[]

      The proper RoteToEmojiData

    • Handle the behaviour once a user adds a reaction or clicks on a button.

      Parameters

      • userAction: MessageReaction | PartialMessageReaction

        the user action, whether it is a reaction or a button interaction

      • user: User | PartialUser

        the user who did the action

      • isReactionRemoval: boolean

        invert the logic of the action (only for reactions)

      Returns Promise<void>

    • Unregisters a channel. When a user reacts to the message in it, nothing will happen.

      Parameters

      • channelID: string

      Returns Promise<void>

      SelfRoleManager#unregisterChannel

    • Parameters

      • member: GuildMember
      • role: Role
      • userAction:
            | MessageReaction
            | PartialMessageReaction
            | StringSelectMenuInteraction<CacheType>
            | ButtonInteraction<CacheType>

      Returns Promise<void>

    • Parameters

      • member: GuildMember
      • role: Role
      • userAction:
            | MessageReaction
            | PartialMessageReaction
            | StringSelectMenuInteraction<CacheType>
            | ButtonInteraction<CacheType>

      Returns Promise<void>

    • Parameters

      • member: GuildMember
      • userAction:
            | MessageReaction
            | PartialMessageReaction
            | StringSelectMenuInteraction<CacheType>
            | ButtonInteraction<CacheType>
      • role: Role
      • requiredRoles: undefined | RoleResolvable[]

      Returns Promise<void>

    • Parameters

      • member: GuildMember
      • userAction:
            | MessageReaction
            | PartialMessageReaction
            | StringSelectMenuInteraction<CacheType>
            | ButtonInteraction<CacheType>
      • numberOfMemberManagedRoles: number
      • numberOfMaxRolesAssigned: undefined | number
      • role: Role

      Returns Promise<void>