mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
fix: Webhook#edit attempting to use client.channels always
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user