Skip to content

MessageThread

Implementation of discords MessageThread object as a Luau builder.

https://discord.com/developers/docs/resources/channel#start-thread-from-message-json-params

MessageThread.name  :: string?

The name of the thread that is displayed.

MessageThread.autoArchiveDuration  :: number?

Duration in minutes to automatically archive the thread after recent activity.

MessageThread.rateLimitPerUser  :: number?

Amount of seconds a user has to wait before sending another message.

MessageThread : setName ( name )  -> MessageThread

Sets the name of the thread. Name must be between 1-100 characters.

Parameters

name: string

Returns

MessageThread
MessageThread : setAutoArchiveDuration ( duration )  -> MessageThread

Sets the duration in minutes before the thread is automatically archived. Duration must be 60, 1440, 4320, or 10080.

Parameters

duration: number

Returns

MessageThread
MessageThread : setRateLimitPerUser ( rateLimit )  -> MessageThread

Sets the rate limit per user in the thread. Rate limit must be less than or equal to 21600 seconds.

Parameters

rateLimit: number

Returns

MessageThread
MessageThread : build ( )  -> JSON

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

Returns

JSON
MessageThread . new ( resource )  -> MessageThread

Responsible for creating a new MessageThread.

local thread = MessageThread.new({
name = "My Thread",
autoArchiveDuration = 60,
rateLimitPerUser = 0
})

Parameters

resource: {
name: string?,
autoArchiveDuration: number?,
rateLimitPerUser: number?,
}

Returns

MessageThread