#How can i delete messages from specific channels i select their ids?
17 messages · Page 1 of 1 (latest)
• 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.
Tag suggestion for @whole pumice:
Frequently Asked Questions: learn more
if all you have is the id, <TextChannel>.messages.delete(<ID>)
const channel = client.channels.cache.get("222086648706498562");
const channel = guild.channels.cache.find(channel => channel.name === "general");
• Caches in discord.js are Collections which extend the native Map structure.
• learn more
What do you mean with id
Id of channel
you want to delete specific messages only using the channel's id?
Yes
I want delete message from more than one channel
By using array
By geting ids by
const ch = message.guild.channels.cache.get(channels)
this still shows how to get a channel by id
but how do you intend to delete a specific message without its id?
By geting ids by
const ch = message.guild.channels.cache.get(channels)
I'm not exactly sure what you mean, but get takes a single id at a time
you can map your array
my question is more about how your code will know which messages to delete