Class SelfRoleManagerAbstract

The manager handling assignation and removal of roles based on user interactions/reactions.

Export

SelfRoleManager

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 | StringSelectMenuInteraction<CacheType> | ButtonInteraction<CacheType>

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

    • Optional user: null | User | PartialUser

      the user who did the action

    • Optional isReactionRemoval: null | boolean

      invert the logic of the action (only for reactions)

    Returns Promise<void>

  • Registers a channel. When a user reacts to the message in it, a role will be given/removed.

    Parameters

    Returns Promise<void>

    Name

    SelfRoleManager#registerChannel

  • Handle the registering of a channel, sending the main message for the automated role-giver system.

    Parameters

    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>