I am creating a discord bot where it sends a message at a certain time every day to the guild. I am using cron
for the scheduled message, but not sure what code to write for the bot to send the message to the 'general' channel of a guild, and if they don't have a 'general' channel, send to the channel with the most activity or messages.
Since defaultChannel
was removed, not sure how I should go about this. Also, I don't want to send the message to a specific channel using channel id because I want to make this bot public so a lot of different guilds can use.
cron.schedule('00 45 12,20 * * *', () => {
//code to send a message to guild's 'default channel' or 'channel with most activity goes here'
}, {
scheduled: true,
timeZone: "America/Los_Angeles"}
);
It doesn't necessarily have to send to 'default' channel or channel with most messages. These are just the options I came up with. Basically, I want the message to go out to just 1 channel where everyone can see it. Any help would be appreciated. Thanks!