A class that manages self-assignable roles using reactions.

Export

Deprecated

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

Hierarchy (view full)

Constructors

Properties

channels: Collection<string, ChannelProperties>

The collection of registered channels.

Name

SelfRoleManager#channels

client: Client<boolean>

The client that instantiated this Manager

Name

SelfRoleManager#client

The options of the manager.

Methods

  • Parameters

    Returns ((oldMember, newMember) => Promise<void>)

      • (oldMember, newMember): Promise<void>
      • Parameters

        • oldMember: GuildMember | PartialGuildMember
        • newMember: GuildMember

        Returns Promise<void>

  • 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

    • Optional emoji: 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>

    Name

    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>