From f293dddc29a0c3939f319b52c6553edb83fa88ad Mon Sep 17 00:00:00 2001 From: Lewdcario Date: Wed, 2 May 2018 21:18:47 -0500 Subject: [PATCH] fix: Webhook#edit attempting to use client.channels always --- src/structures/Webhook.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/structures/Webhook.js b/src/structures/Webhook.js index 50a94bc26..e37d42302 100644 --- a/src/structures/Webhook.js +++ b/src/structures/Webhook.js @@ -1,4 +1,5 @@ const DataResolver = require('../util/DataResolver'); +const { Channel } = require('./Channel'); const { createMessage } = require('./shared'); /** @@ -200,7 +201,7 @@ class Webhook { if (avatar && (typeof avatar === 'string' && !avatar.startsWith('data:'))) { return DataResolver.resolveImage(avatar).then(image => this.edit({ name, avatar: image }, reason)); } - if (channel) channel = this.client.channels.resolveID(channel); + if (channel) channel = channel instanceof Channel ? channel.id : channel; return this.client.api.webhooks(this.id, channel ? undefined : this.token).patch({ data: { name, avatar, channel_id: channel }, reason,