Class: MessageMentions

MessageMentions

Keeps track of mentions in a Message.

Constructor

new MessageMentions()

Source:

Members

(static) CHANNELS_PATTERN :RegExp

Regular expression that globally matches channel mentions like `<#222079895583457280>`
Type:
  • RegExp
Source:

(static) EVERYONE_PATTERN :RegExp

Regular expression that globally matches `@everyone` and `@here`
Type:
  • RegExp
Source:

(static) ROLES_PATTERN :RegExp

Regular expression that globally matches role mentions like `<@&297577916114403338>`
Type:
  • RegExp
Source:

(static) USERS_PATTERN :RegExp

Regular expression that globally matches user mentions like `<@81440962496172032>`
Type:
  • RegExp
Source:

(private, nullable) _channels :Collection.<Snowflake, GuildChannel>

Cached channels for MessageMentions#channels
Type:
Source:

(private, nullable) _members :Collection.<Snowflake, GuildMember>

Cached members for MessageMentions#members
Type:
Source:

(readonly) channels :Collection.<Snowflake, GuildChannel>

Any channels that were mentioned Order as they appear first in the message content
Type:
Source:

crosspostedChannels :Collection.<Snowflake, CrosspostedChannel>

A collection of crossposted channels Order as received from the API, not as they appear in the message content
Type:
Source:

everyone :boolean

Whether `@everyone` or `@here` were mentioned
Type:
  • boolean
Source:

(readonly, nullable) members :Collection.<Snowflake, GuildMember>

Any members that were mentioned (only in TextChannels) Order as received from the API, not as they appear in the message content
Type:
Source:

roles :Collection.<Snowflake, Role>

Any roles that were mentioned Order as received from the API, not as they appear in the message content
Type:
Source:

users :Collection.<Snowflake, User>

Any users that were mentioned Order as received from the API, not as they appear in the message content
Type:
Source:

Methods

has(data, optionsopt) → {boolean}

Checks if a user, guild member, role, or channel is mentioned. Takes into account user mentions, role mentions, and @everyone/@here mentions.
Parameters:
Name Type Attributes Description
data UserResolvable | RoleResolvable | GuildChannelResolvable User/Role/Channel to check
options Object <optional>
Options
Properties
Name Type Attributes Default Description
ignoreDirect boolean <optional>
false Whether to ignore direct mentions to the item
ignoreRoles boolean <optional>
false Whether to ignore role mentions to a guild member
ignoreEveryone boolean <optional>
false Whether to ignore everyone/here mentions
Source:
Returns:
Type
boolean