mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
Add Message.isMentioned
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -284,6 +284,17 @@ class Message {
|
|||||||
return this.client.rest.methods.sendMessage(this.channel, newContent, options.tts);
|
return this.client.rest.methods.sendMessage(this.channel, newContent, options.tts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not a user, channel or role is mentioned in this message.
|
||||||
|
* @param {GuildChannel|User|Role|string} data either a guild channel, user or a role object, or a string representing
|
||||||
|
* the ID of any of these.
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isMentioned(data) {
|
||||||
|
data = data.id ? data.id : data;
|
||||||
|
return this.mentions.users.has(data) || this.mentions.channels.has(data) || this.mentions.roles.has(data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pins this message to the channel's pinned messages
|
* Pins this message to the channel's pinned messages
|
||||||
* @returns {Promise<Message>}
|
* @returns {Promise<Message>}
|
||||||
|
|||||||
Reference in New Issue
Block a user