MessagePayload
classe · Source
Represents a message to be sent to the API.
Constructor
Parameters
| Name | Type | Description |
|---|---|---|
target | MessageTarget | The target for this message to be sent to |
options | MessageOptions | WebhookMessageOptions | Options passed in from send |
Properties
target
The target for this message to be sent to Source
options
Options passed in from send Source
data
nullable
Data sendable to the API Source
files
nullable
Files sendable to the API Source
isWebhook
readonly
Whether or not the target is a Webhook or a WebhookClientSource
isUser
readonly
Whether or not the target is a UserSource
isMessage
readonly
Whether or not the target is a MessageSource
isMessageManager
readonly
Whether or not the target is a MessageManagerSource
isInteraction
readonly
Whether or not the target is an Interaction or an InteractionWebhookSource
Methods
makeContent
Makes the content of this message. Returns: stringSource
resolveData
Resolves data. Returns: MessagePayloadSource
resolveFiles
async
Resolves files. Returns: Promise<MessagePayload>Source
resolveFile
static · async
Resolves a single file into an object sendable to the API. Parameters
| Name | Type | Description |
|---|---|---|
fileLike | BufferResolvable | Stream | FileOptions | MessageAttachment | Something that could be resolved to a file |
Returns: Promise<MessageFile>Source
create
static
Creates a MessagePayload from user-level arguments. Parameters
| Name | Type | Description |
|---|---|---|
target | MessageTarget | Target to send to |
options | string | MessageOptions | WebhookMessageOptions | Options or content to use |
extra? | MessageOptions | WebhookMessageOptions | Extra options to add onto specified options Default: {}. |
Returns: MessagePayloadSource