Enumeration SelfRoleManagerEvents

Events

channelRegister: "channelRegister"

Emitted when a channel is registered. SelfRoleManager#channelRegister

Param: channel

The channel reference

Param: options

The channel options

Example

manager.on(SelfRoleManagerEvents.channelRegister, (channel, options) => {});
channelUnregister: "channelUnregister"

Emitted when a channel is unregistered. SelfRoleManager#channelUnregister

Param: channel

The channel reference

Param: options

The channel options

Example

manager.on(SelfRoleManagerEvents.channelUnregister, (channel, options) => {});
error: "error"

Emitted when an error occurs. SelfRoleManager#error

Param: error

The error object, if applicable

Param: message

The message of the error

Param: args

The possible arguments in case of error when adding/removing a role

Example

manager.on(SelfRoleManagerEvents.error, (error, message, args) => {});
interaction: "interaction"

Emitted when an interaction is made. SelfRoleManager#interaction

Param: rte

The role to emoji data

Param: interaction

The interaction

Example

manager.on(SelfRoleManagerEvents.interaction, (rte, interaction) => {});
maxRolesReach: "maxRolesReach"

Emitted when the maximum of roles is reached for the member. SelfRoleManager#maxRolesReach

Param: member

The guild member

Param: userAction

The user action

Param: nbRoles

The number of current roles assigned to the user

Param: maximumRoles

The maximum roles assignable to the user

Example

manager.on(SelfRoleManagerEvents.maxRolesReach, (member, userAction, nbRoles, maximumRoles, role) => {});
messageCreate: "messageCreate"

Emitted when a message is created. SelfRoleManager#messageCreate

Param: message

The message

Example

manager.on(SelfRoleManagerEvents.messageCreate, (message) => {});
messageDelete: "messageDelete"

Emitted when a message is deleted. SelfRoleManager#messageDelete

Param: message

The message

Example

manager.on(SelfRoleManagerEvents.messageDelete, (message) => {});
messageRetrieve: "messageRetrieve"

Emitted when a message is retrieved. SelfRoleManager#messageRetrieve

Param: message

The message

Example

manager.on(SelfRoleManagerEvents.messageRetrieve, (message) => {});
reactionAdd: "reactionAdd"

Emitted when a reaction is added. SelfRoleManager#reactionAdd

Param: rte

The role to emoji data

Param: message

The message

Deprecated

Example

manager.on(SelfRoleManagerEvents.reactionAdd, (rte, message) => {});
reactionRemove: "reactionRemove"

Emitted when a reaction is removed. SelfRoleManager#reactionRemove

Param: rte

The role to emoji data

Param: message

The message

Deprecated

Example

manager.on(SelfRoleManagerEvents.reactionRemove, (rte, message) => {});
requiredRolesMissing: "requiredRolesMissing"

Emitted when the user wants a role but does not have the required roles to apply for it. SelfRoleManager#requiredRolesMissing

Param: member

The guild member

Param: userAction

The user action

Param: role

The role to add

Param: requiredRoles

The required roles to pass the conditions

Example

manager.on(SelfRoleManagerEvents.requiredRolesMissing, (member, userAction, role, requiredRoles) => {});
roleAdd: "roleAdd"

Emitted when a role is added. SelfRoleManager#roleAdd

Param: role

The role

Param: member

The guild member

Param: userAction

The user action

Example

manager.on(SelfRoleManagerEvents.roleAdd, (role, member, userAction) => {});
roleRemove: "roleRemove"

Emitted when a role is removed. SelfRoleManager#roleRemove

Param: role

The role

Param: member

The guild member

Param: userAction

The user action. When null, it means the bot detected a required role removal and thus removes whatever role is related

Example

manager.on(SelfRoleManagerEvents.roleRemove, (role, member, userAction) => {});