2
votes

I want to make my discord bot make an announcement to a certain channel, based on the Channel ID. I know how to make the bot respond in whatever channel it's talked to, using message.channel.send(), but I was wondering if there was a way to do message.channelID.send() to have the bot talk in a specific channel to make an announcement.

Thanks! Nathan

2

2 Answers

1
votes
 client.channels.find("id", "what ever").send(/*...*/)

All channels are stored in a Collection under the Client.channels prpperty which you can use to get it.

0
votes

Using client.channels.find("id", "what ever").send(/*...*/); will work to send a message to a certain channel, but in the console, an alert is thrown. Using client.channels.get("what ever").send("/*...*/"); does the same job, but without using a discord.js deprecated function.

Thanks to Jonas Wilms!