How to get message by id
for(let channel of interaction.guild.channels.cache) await console.log(channel[1].messages.fetch(messageId))
does not works
8 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.- First,
console.log(await ...)
not await console.log(...)
- Second, channel
isn't a array,
- Third, not all channels have messagesok
thx
the channel has messages
and channel is an array
and its not working 😦
@jpbm135
interaction.guild.channels.cache
isn't a array, is a GuildChannel
https://discord.com/channels/222078108977594368/1013740066327248946/1013786722678612038Send you full code Passing a channel Id to the guilds resolve is suported? Also do not spoonfeed code, #rules 5
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Nah, it will be slower if the message isn't in cache, djs checks the cache before fetching, you are absolutely right 🙂
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
My bad