I coded a part of a bot for discord that supposed to send a message every minute, but after launching the bot, and waiting one minute, the bot still has not sent a message.
I have not tried anything, because I do not know how to fix this problem.
const Discord = require('discord.js')
const client = new Discord.Client()
client.on('ready', function() {
console.log(client.user.username);
});
client.on('message', function(message) {
if (message.content === "$loop") {
var interval = setInterval (function () {
message.channel.send("123")
}, 1 * 1000);
}
});
// token taken out of question for privacy
I expect the bot to be able to send a message (123 in this case) every one minute.
1 * 1000
means it will send a message every one second – Brandon Dyererror
event and adebug
event. I would start there: discord.js.org/#/docs/main/stable/class/Client – Max Baldwin