Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Webhook): #editMessage throws error when content is null #5757

Merged
merged 2 commits into from Jun 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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