A builder that creates API-compatible JSON data for allowed mentions.
Implements
JSONEncodable<APIAllowedMentions>Creates a new allowed mentions builder from API data.
Name | Type | Optional | Description |
---|---|---|---|
data | Partial<APIAllowedMentions> | Yes | The API data to create this allowed mentions builder with |
Adds roles to mention.
Name | Type | Optional | Description |
---|---|---|---|
...roles | RestOrArray<Snowflake> | No | The roles to mention |
Adds users to mention.
Name | Type | Optional | Description |
---|---|---|---|
...users | RestOrArray<Snowflake> | No | The users to mention |
Clears the parse mention types.
Clears the roles to mention.
Clears the users to mention.
Sets the types of mentions to parse from the content.
Name | Type | Optional | Description |
---|---|---|---|
...parse | RestOrArray<AllowedMentionsTypes> | No | The types of mentions to parse from the content |
For replies, sets whether to mention the author of the message being replied to.
Name | Type | Optional | Description |
---|---|---|---|
repliedUser | boolean | Yes | Whether to mention the author of the message being replied to |
Sets the roles to mention.
Name | Type | Optional | Description |
---|---|---|---|
...roles | RestOrArray<Snowflake> | No | The roles to mention |
Sets the users to mention.
Name | Type | Optional | Description |
---|---|---|---|
...users | RestOrArray<Snowflake> | No | The users to mention |
Removes, replaces, or inserts roles.
Remarks
This method behaves similarly to Array.prototype.splice().It's useful for modifying and adjusting order of the already-existing roles.Example
Remove the first role:Example
Remove the first n roles:Example
Remove the last role:Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start at |
deleteCount | number | No | The number of roles to remove |
...roles | RestOrArray<Snowflake> | No | The replacing role ids |
Removes, replaces, or inserts users.
Remarks
This method behaves similarly to Array.prototype.splice().It's useful for modifying and adjusting order of the already-existing users.Example
Remove the first user:Example
Remove the first n users:Example
Remove the last user:Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start at |
deleteCount | number | No | The number of users to remove |
...users | RestOrArray<Snowflake> | No | The replacing user ids |
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
Name | Type | Optional | Description |
---|---|---|---|
validationOverride | boolean | Yes | Force validation to run/not run regardless of your global preference |