Skip to content

MessageMentions

classe · Source

Keeps track of mentions in a Message.

Properties

everyone

everyone: boolean

Whether @everyone or @here were mentioned Source

users

users: Collection<Snowflake, User>

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

roles

roles: Collection<Snowflake, Role>

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

_members

nullable · private

_members: Collection<Snowflake, GuildMember>

Cached members for MessageMentions#membersSource

_channels

nullable · private

_channels: Collection<Snowflake, Channel>

Cached channels for MessageMentions#channelsSource

_parsedUsers

nullable · private

_parsedUsers: Collection<Snowflake, User>

Cached users for MessageMentions#parsedUsersSource

crosspostedChannels

crosspostedChannels: Collection<Snowflake, CrosspostedChannel>

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

repliedUser

nullable

repliedUser: User

The author of the message that this message is a reply to Source

members

readonly · nullable

members: Collection<Snowflake, GuildMember>

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

channels

readonly

channels: Collection<Snowflake, Channel>

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

parsedUsers

readonly

parsedUsers: Collection<Snowflake, User>

Any user mentions that were included in the message content Order as they appear first in the message content Source

EVERYONE_PATTERN

static

EVERYONE_PATTERN: RegExp

Regular expression that globally matches @everyone and @hereSource

USERS_PATTERN

static

USERS_PATTERN: RegExp

Regular expression that globally matches user mentions like &lt;@81440962496172032&gt;Source

ROLES_PATTERN

static

ROLES_PATTERN: RegExp

Regular expression that globally matches role mentions like &lt;@&297577916114403338&gt;Source

CHANNELS_PATTERN

static

CHANNELS_PATTERN: RegExp

Regular expression that globally matches channel mentions like &lt;#222079895583457280&gt;Source

Methods

has

has(data: UserResolvable | RoleResolvable | ChannelResolvable, options?: MessageMentionsHasOptions): boolean

Checks if a user, guild member, thread member, role, or channel is mentioned. Takes into account user mentions, role mentions, channel mentions, replied user mention, and @everyone/@here mentions. Parameters

NameTypeDescription
dataUserResolvable | RoleResolvable | ChannelResolvableThe User/Role/Channel to check for
options?MessageMentionsHasOptionsThe options for the check

Returns: booleanSource

Unofficial software. Not affiliated with or supported by Discord.