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

    Class SelfRoleManagerAbstract

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

    SelfRoleManager

    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

    • Parameters

      Returns (
          oldMember: GuildMember | PartialGuildMember,
          newMember: GuildMember,
      ) => 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

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

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

      • Optionaluser: null | User | PartialUser

        the user who did the action

      • OptionalisReactionRemoval: 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>

      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>

      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>