MessagePayload

export class MessagePayload
export class MessagePayload
Represents a message to be sent to the API.
constructor(target, options)
NameTypeOptionalDescription
targetMessageTargetNoNone
optionsMessagePayloadOptionNoNone
Body sendable to the API
files:RawFile[] | null
Files sendable to the API
Readonly
isInteraction:boolean
Whether or not the target is an BaseInteraction or an
Readonly
isMessage:boolean
Whether or not the target is a Message
Readonly
isMessageManager:boolean
Whether or not the target is a MessageManager
Readonly
isUser:boolean
Whether or not the target is a
Readonly
isWebhook:boolean
Whether or not the target is a or a
The payload of this message.
The target for this message to be sent to
Static
create(target, options, extra?):MessagePayload
Creates a MessagePayload from user-level arguments.
NameTypeOptionalDescription
targetMessageTargetNoTarget to send to
optionsstring | MessagePayloadOptionNoOptions or content to use
extraMessagePayloadOptionYesExtra options to add onto specified options
makeContent():string | undefined
Makes the content of this message.
Returns
resolveBody():this
Resolves the body.
Static
resolveFile(fileLike):Promise<RawFile>
Resolves a single file into an object sendable to the API.
NameTypeOptionalDescription
fileLikeBufferResolvable | Stream | AttachmentPayload | JSONEncodable<AttachmentPayload>NoSomething that could be resolved to a file
resolveFiles():Promise<this>
Resolves files.