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>YesThe 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
channelIdSnowflakeNoThe id of the channel being referenced
setFailIfNotExists(failIfNotExists?):this
Sets whether to fail the message creation if the referenced message does not exist
NameTypeOptionalDescription
failIfNotExistsbooleanYesWhether to fail the message creation if the referenced message does not exist
setGuildId(guildId):this
Sets the id of the guild being referenced
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild being referenced
setMessageId(messageId):this
Sets the id of the message being referenced
NameTypeOptionalDescription
messageIdSnowflakeNoThe id of the message being referenced
setType(type):this
Sets the type of message reference this represents
NameTypeOptionalDescription
typeMessageReferenceTypeNoThe 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
validationOverridebooleanYesForce validation to run/not run regardless of your global preference