MessageThread
Implementation of discords MessageThread object as a Luau builder.
https://discord.com/developers/docs/resources/channel#start-thread-from-message-json-params
Summary
Properties
MessageThread.name :: string?MessageThread.autoArchiveDuration :: number?MessageThread.rateLimitPerUser :: number?Properties
Section titled “Properties”The name of the thread that is displayed.
autoArchiveDuration
Section titled “autoArchiveDuration”Duration in minutes to automatically archive the thread after recent activity.
rateLimitPerUser
Section titled “rateLimitPerUser”Amount of seconds a user has to wait before sending another message.
Methods
Section titled “Methods”setName
Section titled “setName”MessageThread : setName ( name ) -> MessageThread
Sets the name of the thread. Name must be between 1-100 characters.
Parameters
| name: string |
Returns
| MessageThread |
setAutoArchiveDuration
Section titled “setAutoArchiveDuration”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 |
setRateLimitPerUser
Section titled “setRateLimitPerUser”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 |
Functions
Section titled “Functions”MessageThread . new ( resource ) -> MessageThread
Responsible for creating a new MessageThread.
local thread = MessageThread.new({ name = "My Thread", autoArchiveDuration = 60, rateLimitPerUser = 0})