mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
fix(Webhook): #editMessage throws error when content is null (#5757)
This commit is contained in:
@@ -242,14 +242,14 @@ class Webhook {
|
|||||||
/**
|
/**
|
||||||
* Edits a message that was sent by this webhook.
|
* Edits a message that was sent by this webhook.
|
||||||
* @param {MessageResolvable|'@original'} message The message to edit
|
* @param {MessageResolvable|'@original'} message The message to edit
|
||||||
* @param {string|APIMessage} [content] The new content for the message
|
* @param {?(string|APIMessage)} [content] The new content for the message
|
||||||
* @param {WebhookEditMessageOptions|MessageAdditions} [options] The options to provide
|
* @param {WebhookEditMessageOptions|MessageAdditions} [options] The options to provide
|
||||||
* @returns {Promise<Message|Object>} Returns the raw message data if the webhook was instantiated as a
|
* @returns {Promise<Message|Object>} Returns the raw message data if the webhook was instantiated as a
|
||||||
* {@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned
|
* {@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned
|
||||||
*/
|
*/
|
||||||
async editMessage(message, content, options) {
|
async editMessage(message, content, options) {
|
||||||
const { data, files } = await (
|
const { data, files } = await (
|
||||||
content.resolveData?.() ?? APIMessage.create(this, content, options).resolveData()
|
content?.resolveData?.() ?? APIMessage.create(this, content, options).resolveData()
|
||||||
).resolveFiles();
|
).resolveFiles();
|
||||||
const d = await this.client.api
|
const d = await this.client.api
|
||||||
.webhooks(this.id, this.token)
|
.webhooks(this.id, this.token)
|
||||||
|
|||||||
Reference in New Issue
Block a user