Can't change channel of webhook
I'm trying to change the channel of a webhook, to a channel. The channel does exist and the bot has all permissions (the bot owns the guild). The id of the channel also is correctly shown in the requestBody given in the error message.
Error:
DiscordAPIError[10003]: Unknown Channel
at handleErrors (/home/max/Documents/DiscordMessageLinkBot/node_modules/@discordjs/rest/dist/index.js:727:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/max/Documents/DiscordMessageLinkBot/node_modules/@discordjs/rest/dist/index.js:1128:23)
at async SequentialHandler.queueRequest (/home/max/Documents/DiscordMessageLinkBot/node_modules/@discordjs/rest/dist/index.js:959:14)
at async _REST.request (/home/max/Documents/DiscordMessageLinkBot/node_modules/@discordjs/rest/dist/index.js:1272:22)
at async Webhook.edit (/home/max/Documents/DiscordMessageLinkBot/node_modules/discord.js/src/structures/Webhook.js:284:18)
at async Client.<anonymous> (/home/max/Documents/DiscordMessageLinkBot/index.js:35:7) {
requestBody: {
files: undefined,
json: {
name: 'SWORD FIGHT',
avatar: null,
channel_id: '1068865955054223401'
}
},
rawError: { message: 'Unknown Channel', code: 10003 },
code: 10003,
status: 404,
method: 'PATCH',
url: 'https://discord.com/api/v10/webhooks/1321112938597060669'
}
12 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ā
Marked as resolved by OP[email protected] /home/max/Documents/DiscordMessageLinkBot
āāā [email protected]
v22.4.0
there's no property
message.channelId
it's message.channel.id
There is.
As you can see in the error payload, there is the right channel id.
PermissionsBitField { bitfield: 1829587348619263n }
It should have permissions as the bot owns the guild.
Normal guild text channel.
To big for discord, https://pastebin.com/1taYbQSE
Pastebin
TextChannel { type: 0, guild: Guild { id: '10409699 - Pasteb...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Yes, the error happens for all channels in that guild. Only thing that changes is the channel_id in the payload mentioned in the error.
https://pastebin.com/yd7Q1DWb that's the previous channel from the error.
Pastebin
TextChannel { type: 0, guild: Guild { id: '10409699 - Pasteb...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Oh, I printed that and realized that I was still using a hard coded webhook instead of the one that I had stored for that guild. Sorry for wasting your time. It works now.