Reference
Implementation of discords Reference object as a Luau builder.
https://discord.com/developers/docs/resources/message#message-reference-structure
Summary
Properties
Reference.type :: api_types.MessageReferenceTypeReference.messageId :: stringReference.channelId :: stringReference.guildId :: stringReference.failIfNotExists :: booleanMethods
Reference:setType(type: apiTypes.MessageReferenceType) → ReferenceReference:setMessageId(messageId: string) → ReferenceReference:setChannelId(channelId: string) → ReferenceReference:setGuildId(guildId: string) → ReferenceReference:setFailIfNotExists(failIfNotExists: boolean) → ReferenceReference:build() → JSONProperties
Section titled “Properties”The type of reference.
messageId
Section titled “messageId”The id of the originating message.
channelId
Section titled “channelId”The id of the originating message’s channel.
guildId
Section titled “guildId”The id of the originating message’s guild.
failIfNotExists
Section titled “failIfNotExists”When sending, whether to error if the referenced message doesn’t exist instead of sending as a normal (non-reply) message.
Methods
Section titled “Methods”setType
Section titled “setType”Reference : setType ( type ) -> Reference
The type of reference.
Parameters
| type: MessageReferenceType |
Returns
| Reference |
setMessageId
Section titled “setMessageId”Reference : setMessageId ( messageId ) -> Reference
The id of the originating message.
Parameters
| messageId: string |
Returns
| Reference |
setChannelId
Section titled “setChannelId”Reference : setChannelId ( channelId ) -> Reference
The id of the originating message’s channel.
Parameters
| channelId: string |
Returns
| Reference |
setGuildId
Section titled “setGuildId”Reference : setGuildId ( guildId ) -> Reference
The id of the originating message’s guild.
Parameters
| guildId: string |
Returns
| Reference |
setFailIfNotExists
Section titled “setFailIfNotExists”Reference : setFailIfNotExists ( failIfNotExists ) -> Reference
When sending, whether to error if the referenced message doesn’t exist instead of sending as a normal (non-reply) message, default true.
Parameters
| failIfNotExists: boolean |
Returns
| Reference |
Reference : build ( ) -> JSON
Responsible for building the Reference JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”Reference . new ( resource ) -> Reference
Responsible for creating a new Reference.
Parameters
| resource: { type: apiTypes.MessageReferenceType?, messageId: string?, channelId: string?, guildId: string?, failIfNotExists: boolean?, } |
Returns
| Reference |