#How can i delete messages from specific channels i select their ids?

17 messages · Page 1 of 1 (latest)

whole pumice
#

How can i delete messages from specific channels i select their ids?

tough folio
#

• 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.

forest citrusBOT
#

Tag suggestion for @whole pumice:
Frequently Asked Questions: learn more

glacial steeple
#

if all you have is the id, <TextChannel>.messages.delete(<ID>)

forest citrusBOT
#
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

whole pumice
#

Id of channel

glacial steeple
#

you want to delete specific messages only using the channel's id?

whole pumice
#

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)

glacial steeple
whole pumice
glacial steeple
#

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

whole pumice
#

Ahhaa

#

Ok

#

I will map the array