ReactionRole

ReactionRole

Reaction role object structure.

Constructor

new ReactionRole(data) → {ReactionRole}

Reaction Role constructor.

Source:
Parameters:
Name Type Description
data Object
Name Type Attributes Default Description
message string

Message ID of reaction role.

channel string

Channel ID of message.

guild string

Guild ID of channel.

emoji string

Emoji ID of reaction role.

winners Array.<string> <optional>
[]

List with role winners ID;

max number <optional>
Number.MAX_SAFE_INTEGER

Max roles available to give.

toggle boolean <optional>
false

User will have only one of these message roles.

requirements IRequirementType <optional>
{}

Requirements to win this role.

disabled boolean <optional>
false

Is this reaction role disabled?

type ReactionRoleType <optional>
1

Reaction role type

roles Array.<string> <optional>
[]

All roles of this reaction role.

Returns:
Type:
ReactionRole

Members

(readonly) channel :string

Channel ID of message

Source:
Type:
  • string

disabled :boolean

Is this reaction role disabled?

Source:
Type:
  • boolean

(readonly) emoji :string

Emoji identifier

Source:
Type:
  • string

(readonly) guild :string

Guild ID of message

Source:
Type:
  • string

(readonly) id :string

Reaction Role ID (messageId-emojiId)

Source:
Type:
  • string

(readonly) isJustLose :boolean

Is this Just Lose Reaction Role?

Source:
Type:
  • boolean

(readonly) isJustWin :boolean

Is this Just Win Reaction Role?

Source:
Type:
  • boolean

(readonly) isNormal :boolean

Is this Normal Reaction Role?

Source:
Type:
  • boolean

(readonly) isReversed :boolean

Is this Reversed Reaction Role?

Source:
Type:
  • boolean

(readonly) isToggle :boolean

Is this Reaction Toggle Role?

Source:
Type:
  • boolean

max :number

Max roles available to give

Source:
Type:
  • number

(readonly) message :string

Message ID of reaction role

Source:
Type:
  • string

requirements :IRequirementType

Requirement to win this role.

Source:
Type:

(readonly) role :string

Role ID

Deprecated:
  • since 1.8.0, please use `roles` property instead.
Source:
Type:
  • string

roles :Array.<string>

Roles ID's

Source:
Type:
  • Array.<string>

toggle :number

Is it toggled role?

Deprecated:
  • since 1.7.9
Source:
Type:
  • number

type :ReactionRoleType

This reaction role type.

Source:
Type:

(readonly) winners :Array.<string>

List of who won this role

Source:
Type:
  • Array.<string>

Methods

(static) fromJSON(json) → {ReactionRole}

Transform json to Reaction Role object.

Deprecated:
  • since 1.8.0, please use `new ReactionRole(json)` instead.
Source:
Parameters:
Name Type Description
json object

Reaction role data.

Returns:
Type:
ReactionRole

checkBoostRequirement(member) → {boolean}

Check if member have boost requirement to win this roles.

Source:
Parameters:
Name Type Description
member GuildMember

The member to check.

Returns:
Type:
boolean

(async) checkDeveloperRequirement(member) → {Promise.<boolean>}

Check if member have developer requirement to win this roles.

Source:
Parameters:
Name Type Description
member GuildMember

The member to check.

Returns:
Type:
Promise.<boolean>

toJSON() → {JSON}

Convert Reaction Role object to JSON.

Source:
Returns:
Type:
JSON
  • Parsed json object.