Message
Extends
Base
Type Parameters
Type Parameter | Default type |
---|---|
IsPartial extends boolean | false |
Constructors
Constructor
new Message<
IsPartial
>(client
,rawDataOrIds
):Message
<IsPartial
>
Parameters
Parameter | Type |
---|---|
client | Client |
rawDataOrIds | IsPartial extends true ? object : APIMessage |
Returns
Message
<IsPartial
>
Overrides
Base.constructor
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
channelId | readonly | undefined | string | The ID of the channel the message is in | - |
client | public | Client | - | Base.client |
id | readonly | string | The ID of the message | - |
Accessors
applicationId
Get Signature
get applicationId():
IfPartial
<IsPartial
,undefined
|string
>
If this message is a response to an interaction, this is the ID of the interaction's application
Returns
IfPartial
<IsPartial
, undefined
| string
>
attachments
Get Signature
get attachments():
IfPartial
<IsPartial
,APIAttachment
[]>
The attachments of the message
Returns
IfPartial
<IsPartial
, APIAttachment
[]>
author
Get Signature
Get the author of the message
Returns
IfPartial
<IsPartial
, null
| User
<false
>>
components
Get Signature
get components():
IfPartial
<IsPartial
,APIActionRowComponent
<APIMessageActionRowComponent
>[]>
The components of the message
Returns
IfPartial
<IsPartial
, APIActionRowComponent
<APIMessageActionRowComponent
>[]>
content
Get Signature
get content():
IfPartial
<IsPartial
,string
>
The content of the message
Returns
IfPartial
<IsPartial
, string
>
editedTimestamp
Get Signature
get editedTimestamp():
IfPartial
<IsPartial
,null
|string
>
If this message was edited, this is the timestamp of the edit
Returns
IfPartial
<IsPartial
, null
| string
>
embeds
Get Signature
Returns
flags
Get Signature
get flags():
IfPartial
<IsPartial
,MessageFlags
>
The flags of the message
Returns
IfPartial
<IsPartial
, MessageFlags
>
interactionMetadata
Get Signature
get interactionMetadata():
IfPartial
<IsPartial
,undefined
|APIMessageInteractionMetadata
>
The interaction metadata of the message
Returns
IfPartial
<IsPartial
, undefined
| APIMessageInteractionMetadata
>
mentionedEveryone
Get Signature
get mentionedEveryone():
IfPartial
<IsPartial
,boolean
>
Whether the message mentions everyone
Returns
IfPartial
<IsPartial
, boolean
>
mentionedRoles
Get Signature
The roles mentioned in the message
Returns
IfPartial
<IsPartial
, Role
<true
>[]>
mentionedUsers
Get Signature
The users mentioned in the message
Returns
IfPartial
<IsPartial
, User
<false
>[]>
messageReference
Get Signature
get messageReference():
IfPartial
<IsPartial
,undefined
|APIMessageReference
>
The data about the referenced message. You can use Message.referencedMessage to get the referenced message itself.
Returns
IfPartial
<IsPartial
, undefined
| APIMessageReference
>
partial
Get Signature
get partial():
IsPartial
Whether the message is a partial message (meaning it does not have all the data). If this is true, you should use Message.fetch to get the full data of the message.
Returns
IsPartial
pinned
Get Signature
get pinned():
IfPartial
<IsPartial
,boolean
>
Whether the message is pinned
Returns
IfPartial
<IsPartial
, boolean
>
poll
Get Signature
get poll():
IfPartial
<IsPartial
,undefined
|APIPoll
>
The poll contained in the message
Returns
IfPartial
<IsPartial
, undefined
| APIPoll
>
position
Get Signature
get position():
IfPartial
<IsPartial
,undefined
|number
>
The approximate position of the message in the channel
Returns
IfPartial
<IsPartial
, undefined
| number
>
reactions
Get Signature
get reactions():
IfPartial
<IsPartial
,APIReaction
[]>
The reactions on the message
Returns
IfPartial
<IsPartial
, APIReaction
[]>
referencedMessage
Get Signature
get referencedMessage():
IfPartial
<IsPartial
,null
|Message
<false
>>
The referenced message itself
Returns
IfPartial
<IsPartial
, null
| Message
<false
>>
stickers
Get Signature
get stickers():
IfPartial
<IsPartial
,APIStickerItem
[]>
The stickers in the message
Returns
IfPartial
<IsPartial
, APIStickerItem
[]>
thread
Get Signature
get thread():
IfPartial
<IsPartial
,null
|GuildThreadChannel
<AnnouncementThread
|PublicThread
,false
>>
Get the thread associated with this message, if there is one
Returns
IfPartial
<IsPartial
, null
| GuildThreadChannel
<AnnouncementThread
| PublicThread
, false
>>
timestamp
Get Signature
get timestamp():
IfPartial
<IsPartial
,string
>
The timestamp of the original message
Returns
IfPartial
<IsPartial
, string
>
tts
Get Signature
get tts():
IfPartial
<IsPartial
,boolean
>
Whether the message is a TTS message
Returns
IfPartial
<IsPartial
, boolean
>
type
Get Signature
get type():
IfPartial
<IsPartial
,MessageType
>
The type of the message
Returns
IfPartial
<IsPartial
, MessageType
>
Methods
delete()
delete():
Promise
<unknown
>
Delete this message from Discord
Returns
Promise
<unknown
>
edit()
edit(
data
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
data | MessagePayload |
Returns
Promise
<void
>
fetch()
fetch():
Promise
<Message
<false
>>
Fetch updated data for this message. If the message is partial, this will fetch all the data for the message and populate the fields. If the message is not partial, all fields will be updated with new values from Discord.
Returns
Promise
<Message
<false
>>
A Promise that resolves to a non-partial Message
fetchChannel()
fetchChannel():
Promise
<null
|DmChannel
<false
> |GroupDmChannel
<false
> |GuildTextChannel
<false
> |GuildVoiceChannel
<false
> |GuildCategoryChannel
<false
> |GuildAnnouncementChannel
<false
> |GuildThreadChannel
<ThreadChannelType
,false
> |GuildStageChannel
<false
> |GuildForumChannel
<false
> |GuildMediaChannel
>
Get the channel the message was sent in
Returns
Promise
<null
| DmChannel
<false
> | GroupDmChannel
<false
> | GuildTextChannel
<false
> | GuildVoiceChannel
<false
> | GuildCategoryChannel
<false
> | GuildAnnouncementChannel
<false
> | GuildThreadChannel
<ThreadChannelType
, false
> | GuildStageChannel
<false
> | GuildForumChannel
<false
> | GuildMediaChannel
>
forward()
forward(
channelId
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
channelId | string |
Returns
Promise
<void
>
pin()
pin():
Promise
<void
>
Pin this message
Returns
Promise
<void
>
reply()
reply(
data
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
data | MessagePayload |
Returns
Promise
<void
>
startThread()
startThread(
data
):Promise
<GuildThreadChannel
<ThreadChannelType
,false
>>
Start a thread with this message as the associated start message. If you want to start a thread without a start message, use BaseGuildTextChannel.startThread
Parameters
Parameter | Type |
---|---|
data | RESTPostAPIChannelThreadsJSONBody |
Returns
Promise
<GuildThreadChannel
<ThreadChannelType
, false
>>
unpin()
unpin():
Promise
<void
>
Unpin this message
Returns
Promise
<void
>