class AllowedMentionsBuilder

export declare class AllowedMentionsBuilder implements JSONEncodable<APIAllowedMentions>

A builder that creates API-compatible JSON data for allowed mentions.

Constructors

constructor()

Creates a new allowed mentions builder from API data.

addRoles() : this

Adds roles to mention.

addUsers() : this

Adds users to mention.

clearParse() : this

Clears the parse mention types.

clearRoles() : this

Clears the roles to mention.

clearUsers() : this

Clears the users to mention.

setParse() : this

Sets the types of mentions to parse from the content.

setRepliedUser(
repliedUser?: boolean
) : this

For replies, sets whether to mention the author of the message being replied to.

setRoles() : this

Sets the roles to mention.

setUsers() : this

Sets the users to mention.

spliceRoles(
index: number
deleteCount: number
) : this

Removes, replaces, or inserts roles.

Examples:Remove the first role:
allowedMentions.spliceRoles(0, 1);
Remove the first n roles:
const n = 4;
allowedMentions.spliceRoles(0, n);
Remove the last role:
allowedMentions.spliceRoles(-1, 1);

spliceUsers(
index: number
deleteCount: number
) : this

Removes, replaces, or inserts users.

Examples:Remove the first user:
allowedMentions.spliceUsers(0, 1);
Remove the first n users:
const n = 4;
allowedMentions.spliceUsers(0, n);
Remove the last user:
allowedMentions.spliceUsers(-1, 1);

toJSON(
validationOverride?: boolean
) : APIAllowedMentions

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.