Reputation: 79
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
Upvotes: 2
Views: 1000
Reputation: 79
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!
Upvotes: 0
Reputation: 138497
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.
Upvotes: 1