mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
feat(APIMessage): remove disableMentions (#4836)
* chore: remove disableMentions * style: fix eslint
This commit is contained in:
@@ -88,22 +88,6 @@ class APIMessage {
|
||||
|
||||
if (typeof content !== 'string') return content;
|
||||
|
||||
const disableMentions =
|
||||
typeof this.options.disableMentions === 'undefined'
|
||||
? this.target.client.options.disableMentions
|
||||
: this.options.disableMentions;
|
||||
if (disableMentions === 'all') {
|
||||
content = Util.removeMentions(content);
|
||||
} else if (disableMentions === 'everyone') {
|
||||
content = content.replace(/@([^<>@ ]*)/gmsu, (match, target) => {
|
||||
if (target.match(/^[&!]?\d+$/)) {
|
||||
return `@${target}`;
|
||||
} else {
|
||||
return `@\u200b${target}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const isSplit = typeof this.options.split !== 'undefined' && this.options.split !== false;
|
||||
const isCode = typeof this.options.code !== 'undefined' && this.options.code !== false;
|
||||
const splitOptions = isSplit ? { ...this.options.split } : undefined;
|
||||
|
||||
@@ -86,8 +86,6 @@ class Webhook {
|
||||
* @property {Object[]} [embeds] An array of embeds for the message
|
||||
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
|
||||
* (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)
|
||||
* @property {DisableMentionType} [disableMentions=this.client.options.disableMentions] Whether or not all mentions or
|
||||
* everyone/here mentions should be sanitized to prevent unexpected mentions
|
||||
* @property {FileOptions[]|string[]} [files] Files to send with the message
|
||||
* @property {string|boolean} [code] Language for optional codeblock formatting to apply
|
||||
* @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if
|
||||
|
||||
@@ -59,8 +59,6 @@ class TextBasedChannel {
|
||||
* @property {MessageEmbed|Object} [embed] An embed for the message
|
||||
* (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)
|
||||
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
|
||||
* @property {DisableMentionType} [disableMentions=this.client.options.disableMentions] Whether or not all mentions or
|
||||
* everyone/here mentions should be sanitized to prevent unexpected mentions
|
||||
* @property {FileOptions[]|BufferResolvable[]} [files] Files to send with the message
|
||||
* @property {string|boolean} [code] Language for optional codeblock formatting to apply
|
||||
* @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if
|
||||
@@ -85,14 +83,6 @@ class TextBasedChannel {
|
||||
* @typedef {string} MessageMentionTypes
|
||||
*/
|
||||
|
||||
/**
|
||||
* The type of mentions to disable.
|
||||
* - `none`
|
||||
* - `all`
|
||||
* - `everyone`
|
||||
* @typedef {string} DisableMentionType
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} FileOptions
|
||||
* @property {BufferResolvable} attachment File to attach
|
||||
|
||||
Reference in New Issue
Block a user