- Edited
Maybe it is also an option to work with this:
const Discord = require('discord.js');
const client = new Discord.Client({
intents: ["GUILDS","GUILD_MESSAGES"]
});
client.on("messageCreate", (message) => {
console.log(message)
})
client.login('API KEY');
Whenever someone writes something to a channel, the function is executed. So you can work more "interactive" or "just in time".