Skip to content

Commit

Permalink
fix(guildchannelmanager): correctly access channel ID
Browse files Browse the repository at this point in the history
  • Loading branch information
ImRodry committed Jan 26, 2022
1 parent 1082340 commit b9c2667
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/discord.js/src/managers/GuildChannelManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class GuildChannelManager extends CachedManager {
if (typeof avatar === 'string' && !avatar.startsWith('data:')) {
avatar = await DataResolver.resolveImage(avatar);
}
const data = await this.client.rest.post(Routes.channelWebhooks(this.id), {
const data = await this.client.rest.post(Routes.channelWebhooks(id), {
body: {
name,
avatar,
Expand Down Expand Up @@ -261,7 +261,7 @@ class GuildChannelManager extends CachedManager {
}
}

const newData = await this.client.rest.patch(Routes.channel(this.id), {
const newData = await this.client.rest.patch(Routes.channel(channel.id), {
body: {
name: (data.name ?? channel.name).trim(),
type: data.type,
Expand Down Expand Up @@ -362,7 +362,7 @@ class GuildChannelManager extends CachedManager {
async fetchWebhooks(channel) {
const id = this.resolveId(channel);
if (!id) throw new TypeError('INVALID_TYPE', 'channel', 'GuildChannelResolvable');
const data = await this.client.rest.get(Routes.channelWebhooks(this.id));
const data = await this.client.rest.get(Routes.channelWebhooks(id));
return data.reduce((hooks, hook) => hooks.set(hook.id, new Webhook(this.client, hook)), new Collection());
}

Expand Down

0 comments on commit b9c2667

Please sign in to comment.