Skip to content

Reference

Implementation of discords Reference object as a Luau builder.

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

Reference.type  :: MessageReferenceType

The type of reference.

Reference.messageId  :: string

The id of the originating message.

Reference.channelId  :: string

The id of the originating message’s channel.

Reference.guildId  :: string

The id of the originating message’s guild.

Reference.failIfNotExists  :: boolean

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

Reference : setType ( type )  -> Reference

The type of reference.

Parameters

type: MessageReferenceType

Returns

Reference
Reference : setMessageId ( messageId )  -> Reference

The id of the originating message.

Parameters

messageId: string

Returns

Reference
Reference : setChannelId ( channelId )  -> Reference

The id of the originating message’s channel.

Parameters

channelId: string

Returns

Reference
Reference : setGuildId ( guildId )  -> Reference

The id of the originating message’s guild.

Parameters

guildId: string

Returns

Reference
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
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