Difficulty sending messages to specific channels when using command handlers.

Creating a verify embed command. My goal is making it function like this. - send command in separate channel - have bot send the embed to the correct channel its self so I can use buttons (since they do not work on webhooks) I am having issues sending this messages without using webhooks.
No description
No description
5 Replies
d.js toolkit
d.js toolkit14mo ago
- 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
Syjalo
Syjalo14mo ago
You forgot to resolve the Promise from fetch. Btw all guild channels are cached, so you don't need to fetch them.
zyy
zyyOP14mo ago
Struggling to understand this. I resolved my promise. It should be cast as a TextChannel which has a .send function, yet, I still am receiving the same error. @Syjalo resolved promise by adding await in front of my channel.send, no change. fixed.
zyy
zyyOP14mo ago
Fixed:
const channel = interaction.guild.channels.cache.get('1164739651718873189');
await channel.send({ embeds: [embed], components: [row] });
const channel = interaction.guild.channels.cache.get('1164739651718873189');
await channel.send({ embeds: [embed], components: [row] });
Want results from more Discord servers?
Add your server