Skip to content

Commit

Permalink
fix(Webhook): #editMessage throws error when content is null (#5757)
Browse files Browse the repository at this point in the history
  • Loading branch information
iShibi committed Jun 5, 2021
1 parent f0dad26 commit 2901fd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/structures/Webhook.js
Expand Up @@ -242,14 +242,14 @@ class Webhook {
/**
* Edits a message that was sent by this webhook.
* @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
* @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
*/
async editMessage(message, content, options) {
const { data, files } = await (
content.resolveData?.() ?? APIMessage.create(this, content, options).resolveData()
content?.resolveData?.() ?? APIMessage.create(this, content, options).resolveData()
).resolveFiles();
const d = await this.client.api
.webhooks(this.id, this.token)
Expand Down

0 comments on commit 2901fd5

Please sign in to comment.