Skip to content

Reference

Implementation of discords Reference object as a Luau builder.

https://discord.com/developers/docs/resources/message#message-reference-structure

Properties

The Reference instance has no set properties!

Methods

The Reference instance has no set methods!

Functions

setType

Reference . setType (

     self: Reference
     type: apiTypes.MessageReferenceType
)  -> ()

The type of reference.

setMessageId

Reference . setMessageId (

     self: Reference
     messageId: string
)  -> ()

The id of the originating message.

setChannelId

Reference . setChannelId (

     self: Reference
     channelId: string
)  -> ()

The id of the originating message’s channel.

setGuildId

Reference . setGuildId (

     self: Reference
     guildId: string
)  -> ()

The id of the originating message’s guild.

setFailIfNotExists

Reference . setFailIfNotExists (

     self: Reference
     failIfNotExists: boolean
)  -> ()

When sending, whether to error if the referenced message doesn’t exist instead of sending as a normal (non-reply) message, default true.

build

Reference . build (

     self: Reference
)  -> ()

Responsible for building the Reference JSON that can be parsed by the Discord API.

new

Reference . new (

     resource: {
       type: apiTypes.MessageReferenceType?,
       messageId: string?,
       channelId: string?,
       guildId: string?,
       failIfNotExists: boolean?,
    }
)  -> ()

Responsible for creating a new Reference.