MessageReferenceBuilder

export declare class MessageReferenceBuilder implements JSONEncodable<RESTAPIMessageReference>
export declare class MessageReferenceBuilder implements JSONEncodable<RESTAPIMessageReference>
A builder that creates API-compatible JSON data for message references.
constructor(data?)
Creates a new message reference builder from API data.
NameTypeOptionalDescription
dataPartial<RESTAPIMessageReference>Yes
The API data to create this message reference builder with
clearChannelId():this
Clear the id of the channel being referenced
clearGuildId():this
Clear the id of the guild being referenced
clearType():this
Clear the type of message reference this represents
setChannelId(channelId):this
Sets the id of the channel being referenced
NameTypeOptionalDescription
channelIdSnowflakeNo
The id of the channel being referenced
setFailIfNotExists(failIfNotExists?):this
Sets whether to fail the message creation if the referenced message does not exist
NameTypeOptionalDescription
failIfNotExistsbooleanYes
Whether to fail the message creation if the referenced message does not exist
setGuildId(guildId):this
Sets the id of the guild being referenced
NameTypeOptionalDescription
guildIdSnowflakeNo
The id of the guild being referenced
setMessageId(messageId):this
Sets the id of the message being referenced
NameTypeOptionalDescription
messageIdSnowflakeNo
The id of the message being referenced
setType(type):this
Sets the type of message reference this represents
NameTypeOptionalDescription
typeMessageReferenceTypeNo
The type of message reference
toJSON(validationOverride?):RESTAPIMessageReference
Serializes this builder to API-compatible JSON data.
Note that by disabling validation, there is no guarantee that the resulting object will be valid.
NameTypeOptionalDescription
validationOverridebooleanYes
Force validation to run/not run regardless of your global preference