Message is a message sent in a channel. You get one from the events about messages, from what send() and reply() return, and from fetchMessage() and fetchMessages() on a channel.
How to send, edit and read messages is in Sending messages; everything
reply() and edit() accept is in Message options.Properties
The text of the message. Empty when the bot is not allowed to read it: reading the messages of others needs the Message Content intent.
The kind of message, as a value of
MessageType (a regular one, a reply, a join notice…).The embeds of the message. Each entry is an
Embed.The files attached to the message. Each entry is an
Attachment.The reactions on the message, one entry per emoji. Each entry is a
Reaction.Helpers
These read what the bot already knows: they never send a request.toJSON()
Reading from Discord
fetch()
fetchReactionUsers()
Actions
reply()
MessageInput.
Discord documentation
edit()
MessageEditOptions.
Discord documentation
delete()
react()
removeReaction()
clearReactions()
pin()
unpin()
crosspost()
startThread()
After how many minutes without activity the thread leaves the channel list: 60, 1440, 4320 or 10080.
Waiting
They wait for what comes next on the message, while your bot runs: a restart ends the wait. How to use them is in the guide.waitForClick()
from), anyone by default. Resolves with the click, to answer with click.interaction, or null when within (one minute by default) passed first. A click taken here does not run the run of the button; a button that is only waited for needs none. A restart of the bot ends the wait.
waitForReaction()
from), anyone’s but a bot’s by default, with an emoji (emoji), any by default. Resolves with it, or null when within (one minute by default) passed first. A restart of the bot ends the wait.
Types
GuildMessage
A message of a server: its server is known. It is what the events about messages give for what happens in a server.MemberMessage
A message written in a server by one of its members: neither a private message nor the message of a webhook. It is what the events about messages give by default. It has everything ofGuildMessage, and:
PrivateMessage
A private message, for a file that receives both kinds ({ where: 'both' }): there is no server, which is how it is told apart from a GuildMessage.
DmMessage
A private message, for a file that only receives those ({ where: 'dm' }): nothing about a server exists on it. guildId, guild and member are not even offered by your editor.
You only need these names to type a function of your own:
EmojiInput
"👍"), or a custom one. The methods that take one accept:
- a standard emoji:
'👍' - a custom emoji as Discord writes it:
'<:name:123456789012345678>'(or'<a:name:…>'when animated) - a custom emoji as an object:
{ id: '123456789012345678', name: 'name' }, or aGuildEmoji
MessageFlagName
MessageFlags. It is what flags lists.
WaitForClickOptions
WhatwaitForClick() takes.
Only a click of this person. Anyone by default. A
PersonInput.Click
A click on a button or a menu of a message, aswaitForClick() gives it.
The click itself: answer it as in the
run of a button, with update(), reply() or deferUpdate(). Without an answer within 2 seconds, the bot changes nothing on screen for you (deferUpdate()).What was picked in a menu: the values of a menu of texts, the ids of the people, roles or channels of the others. Empty for a button.
Whether it is this button or this menu.
WaitForReactionOptions
WhatwaitForReaction() takes.
Only this emoji: a standard one (
'👍'), or a custom one by its name, its id or as Discord writes it ('<:party:123>').WaitedReaction
A reaction added to a message, aswaitForReaction() gives it.
Elsewhere
AttachmentandReaction: the entries ofattachmentsandreactions.Embed: the entries ofembeds, and what you send.MessageInputandMessageEditOptions: whatreply()andedit()take.