Message - truemedian/Discordia GitHub Wiki
Inherits Snowflake
Represents a text message sent in a Discord text channel. Messages can contain simple content strings, rich embeds, attachments, or reactions.
setContent
setEmbed
pin
unpin
addReaction
removeReaction
clearReactions
delete
reply
reactions
mentionedUsers
mentionedRoles
mentionedEmojis
mentionedChannels
cleanContent
mentionsEveryone
pinned
tts
nonce
editedTimestamp
oldContent
content
author
channel
type
embed
attachment
embeds
attachments
guild
member
Sets the message's content. The message must be authored by the current user (ie: you cannot change the content of messages sent by other users). The content must be from 1 to 2000 characters in length.
Name Type content string Returns: boolean
Sets the message's embed. The message must be authored by the current user. (ie: you cannot change the embed of messages sent by other users).
Name Type embed table Returns: boolean
Pins the message in the channel.
Returns: boolean
Unpins the message in the channel.
Returns: boolean
Adds a reaction to the message. Note that this does not return the new reaction object; wait for the
reactionAdd
event instead.
Name Type emoji Emoji Resolvable Returns: boolean
Removes a reaction from the message. Note that this does not return the old reaction object; wait for the
reactionAdd
event instead. If no user is indicated, then this will remove the current user's reaction.
Name Type Optional emoji Emoji Resolvable id User ID Resolvable x Returns: boolean
Removes all reactions from the message.
Returns: boolean
Permanently deletes the message. This cannot be undone!
Returns: boolean
Equivalent to
Message.channel:send(content)
.
Name Type content string Returns: Message
An iterable cache of all reactions that exist for this message.
Type: Cache
An iterable array of all users that are mentioned in this message. Object order is not guaranteed.
Type: ArrayIterable
An iterable array of known roles that are mentioned in this message, excluding the default everyone role. The message must be in a guild text channel and the roles must be cached in that channel's guild for them to appear here. Object order is not guaranteed.
Type: ArrayIterable
An iterable array of all known emojis that are mentioned in this message. If the client does not have the emoji cached, then it will not appear here. Object order is not guaranteed.
Type: ArrayIterable
An iterable array of all known channels that are mentioned in this message. If the client does not have the channel cached, then it will not appear here. Object order is not guaranteed.
Type: ArrayIterable
The message content with all recognized mentions replaced by names and with @everyone and @here mentions escaped by a zero-width space (ZWSP).
Type: string
Whether this message mentions @everyone or @here.
Type: boolean
Whether this message belongs to its channel's pinned messages.
Type: boolean
Whether this message is a text-to-speech message.
Type: boolean
Used by the official Discord client to detect the success of a sent message.
Type: string|number|boolean|nil
The date and time at which the message was most recently edited, represented as an ISO 8601 string plus microseconds when available.
Type: string|nil
Yields a table containing keys as timestamps and value as content of the message at that time.
Type: string|table
The raw message content. This should be between 0 and 2000 characters in length.
Type: string
The object of the user that created the message.
Type: User
The channel in which this message was sent.
Type: TextChannel
The message type. Use the
messageType
enumeration for a human-readable representation.Type: number
A raw data table that represents the first rich embed that exists in this message. See the Discord documentation for more information.
Type: table|nil
A raw data table that represents the first file attachment that exists in this message. See the Discord documentation for more information.
Type: table|nil
A raw data table that contains all embeds that exist for this message. If there are none, this table will not be present.
Type: table
A raw data table that contains all attachments that exist for this message. If there are none, this table will not be present.
Type: table
The guild in which this message was sent. This will not exist if the message was not sent in a guild text channel. Equivalent to
Message.channel.guild
.Type: Guild|nil
The member object of the message's author. This will not exist if the message is not sent in a guild text channel or if the member object is not cached. Equivalent to
Message.guild.members:get(Message.author.id)
.Type: Member|nil
Inherited from Container
A shortcut to the client object to which this container is visible.
Type: Client
The parent object of to which this container is a child. For example, the parent of a role is the guild in which the role exists.
Type: Container|Client
Inherited from Snowflake
The Snowflake ID that can be used to identify the object. This is guaranteed to be unique except in cases where an object shares the ID of its parent.
Type: string
The Unix time in seconds at which this object was created by Discord. Additional decimal points may be present, though only the first 3 (milliseconds) should be considered accurate.
Type: number
The date and time at which this object was created by Discord, represented as an ISO 8601 string plus microseconds when available.
Equivalent to Date.fromSnowflake(Snowflake.id):toISO()
.
Type: string