Constructor
new Message(client, data, options)
- Description:
Creates the structure for a message.
- Source:
- See:
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
client |
Client | The client instance. |
||||||||||||||||||||
data |
Object | Message data returned from Discord. |
||||||||||||||||||||
options |
Object | Additional options for this structure. Properties
|
Members
(readonly) attachments :Array.<Attachment>
- Description:
The message attachments.
- Source:
The message attachments.
Type:
- Array.<Attachment>
(readonly) author :User
- Description:
The user who sent the message.
- Source:
The user who sent the message.
Type:
(readonly) authorId :String
- Description:
The id of the user who sent the message.
- Source:
The id of the user who sent the message.
Type:
- String
(readonly, nullable) channel :Channel
- Description:
The channel that this message belongs to.
- Source:
The channel that this message belongs to.
Type:
(readonly) channelId :String
- Description:
The channel that this message belongs to.
- Source:
The channel that this message belongs to.
Type:
- String
(readonly, nullable) content :String
- Description:
The message content.
- Source:
The message content.
Type:
- String
(readonly, nullable) editedTimestamp :Number
- Description:
The timestamp for when this message was last edited.
- Source:
The timestamp for when this message was last edited.
Type:
- Number
(readonly) embeds :Array.<Embed>
- Description:
The message embeds.
- Source:
The message embeds.
Type:
- Array.<Embed>
(readonly) flags :Array.<String>
- Description:
The flags of the message.
- Source:
- See:
The flags of the message.
Type:
- Array.<String>
(readonly) flagsRaw :Number
- Description:
The raw flags of the message.
- Source:
The raw flags of the message.
Type:
- Number
(readonly, nullable) guild :Guild
- Description:
The guild that this message belongs to.
- Source:
The guild that this message belongs to.
Type:
(readonly) guildId :String
- Description:
The guild that this message belongs to.
- Source:
The guild that this message belongs to.
Type:
- String
(readonly) hashName :String
- Description:
The hash name for the message.
- Source:
The hash name for the message.
Type:
- String
(readonly) id :String
- Description:
The id of the message.
- Source:
The id of the message.
Type:
- String
(readonly, nullable) member :Member
- Description:
The member who sent the message.
- Source:
The member who sent the message.
Type:
(readonly) mentionEveryone :Boolean
- Description:
Whether this message mentions everyone.
- Source:
Whether this message mentions everyone.
Type:
- Boolean
(readonly) mentionRoles :Boolean
- Description:
Whether this message includes role mentions.
- Source:
Whether this message includes role mentions.
Type:
- Boolean
(readonly) mentions :Boolean
- Description:
Whether this message includes user mentions.
- Source:
Whether this message includes user mentions.
Type:
- Boolean
(readonly, nullable) messageSnapshots :Object
- Description:
The snapshot data about the message.
- Source:
The snapshot data about the message.
Type:
- Object
(readonly) mirrored :Boolean
- Description:
Whether another message has replaced this original message.
- Source:
Whether another message has replaced this original message.
Type:
- Boolean
(readonly) pinned :Boolean
- Description:
Whether this message has been pinned.
- Source:
Whether this message has been pinned.
Type:
- Boolean
(readonly, nullable) poll :Poll
- Description:
The message poll.
- Source:
The message poll.
Type:
(readonly) reactions :MessageReactionManager
- Description:
The message reactions.
- Source:
The message reactions.
Type:
(readonly) reference :Object
- Description:
The message that this message references.
- Source:
The message that this message references.
Type:
- Object
(readonly) stickerItems :Array.<Sticker>
- Description:
Stickers sent with this message.
- Source:
Stickers sent with this message.
Type:
- Array.<Sticker>
(readonly) timestamp :Number
- Description:
The UNIX (seconds) timestamp for when this message was created.
- Source:
The UNIX (seconds) timestamp for when this message was created.
Type:
- Number
(readonly) type :Number
- Description:
The type of message.
- Source:
The type of message.
Type:
- Number
(readonly) url :String
- Description:
The URL of the message.
- Source:
The URL of the message.
Type:
- String
(readonly, nullable) webhookId :String
- Description:
The id of the webhook this message is from.
- Source:
The id of the webhook this message is from.
Type:
- String
Methods
(static) decrypt(client, data, guildId, channelId, messageId) → {Message}
- Description:
Decrypts a message.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
client |
Client | The client instance. |
data |
String | The encrypted message data. |
guildId |
String | The id of the guild that the message belongs to. |
channelId |
String | The id of the channel that the message belongs to. |
messageId |
String | The id of the message. |
Throws:
Returns:
- Type
- Message
(async, static) delete(client, channelId, messageId, optionsnullable) → {Promise.<void>}
- Description:
Deletes one message.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
client |
Client | The client instance. |
|||||||||
channelId |
String | The id of the channel that the message belongs to. |
|||||||||
messageId |
String | The id of the message to delete. |
|||||||||
options |
Object |
<nullable> |
Properties
|
Throws:
Returns:
- Type
- Promise.<void>
(async, static) edit(client, channelId, messageId, guildId, optionsnullable) → {Promise.<Message>}
- Description:
Edits a message.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
client |
Client | The client instance. |
|||||||||||||||||||||||||
channelId |
String | The id of the channel the message belongs to. |
|||||||||||||||||||||||||
messageId |
String | The id of the message. |
|||||||||||||||||||||||||
guildId |
String | The id of the guild the message belongs to. |
|||||||||||||||||||||||||
options |
Object |
<nullable> |
The message options. Properties
|
Returns:
- Type
- Promise.<Message>
(static) getHashName(guildId, channelId, messageId) → {String}
- Description:
Returns the hash name for the message.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
guildId |
String | The id of the guild that the message belongs to. |
channelId |
String | The id of the channel that the message belongs to. |
messageId |
String | The id of the message. |
Throws:
Returns:
- Type
- String
(static) getUrl(guildId, channelId, messageId) → {String}
- Description:
The URL of the message.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
guildId |
String | The id of the guild that the message belongs to. |
channelId |
String | The id of the channel that the message belongs to. |
messageId |
String | The id of the message. |
Returns:
- Type
- String
(async, static) send(client, channelId, guildId, optionsnullable) → {Promise.<Message>}
- Description:
Posts a message to the specified channel.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
client |
Client | The client instance. |
|||||||||||||||||||||||||
channelId |
String | The id of the channel to send the message to. |
|||||||||||||||||||||||||
guildId |
String | The id of the guild which the channel belongs to. |
|||||||||||||||||||||||||
options |
Object |
<nullable> |
Content, embeds, components and files to attach to the message. Properties
|
Throws:
Returns:
- Type
- Promise.<Message>
(static) sendValidation(options) → {void}
- Description:
Validates the message content, embeds, components and files.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | The message options. Properties
|
Throws:
Returns:
- Type
- void
(static) shouldCache(gluonCacheOptions, guildCacheOptions, channelCacheOptions) → {Boolean}
- Description:
Determines whether the message should be cached.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
gluonCacheOptions |
GluonCacheOptions | The cache options for the client. |
guildCacheOptions |
GuildCacheOptions | The cache options for the guild. |
channelCacheOptions |
ChannelCacheOptions | The cache options for the channel. |
Returns:
- Type
- Boolean
(async) delete(optionsnullable) → {Promise.<void>}
- Description:
Deletes the message.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<nullable> |
The options for deleting the message. Properties
|
Returns:
- Type
- Promise.<void>
(async) edit(optionsnullable) → {Promise.<Message>}
- Description:
Edits the message, assuming it is sent by the client user.
- Source:
- See:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<nullable> |
Content, embeds and components to attach to the message. Properties
|
Throws:
Returns:
- Type
- Promise.<Message>
encrypt() → {String}
- Description:
Encrypts the message.
- Source:
Returns:
- Type
- String
(async) reply(optionsnullable) → {Promise.<Message>}
- Description:
Replies to the message.
- Source:
- See:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<nullable> |
Embeds, components and files to attach to the message. Properties
|
Throws:
Returns:
- Type
- Promise.<Message>
toJSON(format) → {Object}
- Description:
Returns the JSON representation of this structure.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
format |
Number | The format to return the data in. |
Returns:
- Type
- Object
toString()
- Source: