Edit message in thread

I'm trying to edit a message inside a thread, I've channelID(Contains thread), threadID(Contains message) and messageID, I'm not able to figure out how to do so. I'm trying something like this but no luck
const tmp = await interaction.guild.channels.cache.get(threadId).fetchMessageById(messageId);
const tmp = await interaction.guild.channels.cache.get(threadId).fetchMessageById(messageId);
3 Replies
d.js toolkit
d.js toolkit15mo 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!
treble/luna
treble/luna15mo ago
<ThreadChannel>.fetchMessageById doesnt exist and also, i dont think threads are cached
GMDMCD
GMDMCDOP15mo ago
Experimented few things and finally got it working like this -
const messageEdit = await interaction.guild.channels.cache.get(threadId).messages.fetch(messageId);
const messageEdit = await interaction.guild.channels.cache.get(threadId).messages.fetch(messageId);
Want results from more Discord servers?
Add your server