Skip to content
Advertisement

How to send a message to a Channel on all Servers

I would like to send a message to all channels that are in all servers that are called “labycheck-shop” at 12 midnight. I have already tried this but it did not work:

JavaScript

Advertisement

Answer

  1. This feature can turn out to be spammy on the Discord API, so you might want to keep that in mind

  2. I believe that you might be wanting to use <Collection>.filter instead of <Collection>.find. The find function in the Discord.js Collections works pretty much like <Array>.find, which returns the first result it gets true for. So what you’ll want to do is, use <Collection>.filter to filter the guilds of that name, and then Loop through the array and send the message.

So kinda like this

JavaScript

That’s how it should work out, I also checked the cron expression, and that looks fine as well

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement