Message
Implementation of the Discord Message class in Luau
https://discord.com/developers/docs/resources/message#message-object
Properties
id
The ID of the message.
channelId
The ID of the channel the message was sent in.
author
The author of this message.
content
The content of the message.
timestamp
When this message was sent.
tts
Whether this was a TTS message.
mentionEveryone
Whether this message mentions everyone.
mentionChannels
Channels specifically mentioned in this message.
mentionRoles
Roles specifically mentioned in this message.
mentionChannels
Channels specifically mentioned in this message.
attachments
Any attachments to the message.
embeds
Any embedded content in the message.
reactions
Reactions to the message.
nonce
Used for validating a message was sent.
pinned
Whether this message is pinned.
webhookId
If the message is generated by a webhook, this is the webhook’s ID.
activity
Activity information for Rich Presence messages.
application
Application information for Rich Presence messages.
applicationId
If the message is an Interaction or application-owned webhook, this is the ID of the application.
flags
Message flags combined as a bitfield.
messageReference
Reference data for crossposted messages and replies.
referencedMessage
The message that was referenced in a reply.
interactionMetadata
Metadata for interaction messages.
interaction
Interaction information if the message is a response to an Interaction.
components
Components attached to the message.
stickerItems
Stickers attached to the message.
position
Position of the message in a thread.
roleSubscriptionData
Data for role subscription purchase or renewal notifications.
poll
Poll attached to the message.
call
Call information if this message started a call.
resolved
Resolved objects from the interaction data.
Methods
The Message instance has no set methods!
Functions
startThreadAsync
Message . startThreadAsync () -> ()
self: Message
threadName: string
autoArchiveDuration: number
rateLimitPerUser: number?
Creates a new thread from an existing message.
addReactionAsync
Message . addReactionAsync () -> ()
self: Message
emoji: builders.emojiJSON | string
Add a reaction to a message. Requires READ_MESSAGE_HISTORY and ADD_REACTIONS permissions.
removeOwnReactionAsync
Message . removeOwnReactionAsync () -> ()
self: Message
emoji: builders.emojiJSON | string
Remove the current user’s reaction from a message
deleteUserReactionAsync
Message . deleteUserReactionAsync () -> ()
self: Message
emoji: builders.emojiJSON | string
userId: apiTypes.Snowflake
Remove another user’s reaction from a message. Requires MANAGE_MESSAGES permission.
getReactionsAsync
Message . getReactionsAsync () -> ()
self: Message
emoji: builders.emojiJSON | string
reactionType: apiTypes.ReactionType?
afterUserId: apiTypes.Snowflake?
limit: number?
Get a list of users that reacted with a specific emoji
deleteAllReactionsAsync
Message . deleteAllReactionsAsync () -> ()
self: Message
Remove all reactions from a message. Requires MANAGE_MESSAGES permission.
deleteAllReactionsForEmojiAsync
Message . deleteAllReactionsForEmojiAsync () -> ()
self: Message
emoji: builders.emojiJSON | string
Remove all reactions of a specific emoji from a message. Requires MANAGE_MESSAGES permission.
editAsync
Message . editAsync () -> ()
self: Message
message: builders.messageJSON
Edit a message. The current user must be the author of the message.
deleteAsync
Message . deleteAsync () -> ()
self: Message
reason: string?
Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the current user, this endpoint requires the MANAGE_MESSAGES permission.
replyAsync
Message . replyAsync () -> ()
self: Message
message: builders.messageJSON
Reply to a message by creating a new message that references this one.
pinAsync
Message . pinAsync () -> ()
self: Message
Pin this message to the channel. Requires MANAGE_MESSAGES permission.
unpinAsync
Message . unpinAsync () -> ()
self: Message
Unpin this message from the channel. Requires MANAGE_MESSAGES permission.
sync
Message . sync () -> ()
self: Message
messageData: apiTypes.MessageObject
Synchronizes the message object with the data from the API.
new
Message . new () -> ()
state: state.State
messageData: apiTypes.MessageObject
Creates a new Message instance with the specified message data.