mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
fix: Webhook#edit attempting to use client.channels always
This commit is contained in:
parent
bd83bb9fd6
commit
f293dddc29
1 changed files with 2 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue