I'm making my first Discord bot and the idea is that when a user sends a message to a channel, the bot simply repeats it. I have this set up, but the problem is that it goes into a loop and just keeps repeating. How can I break that so he repeats only once?
const Commando = require('discord.js-commando');
const bot = new Commando.Client();
bot.on('message', (message) => {
if (message.content){
message.channel.sendMessage(message.content);
}
})
`
You can use the
idof the user that sent the message to make sure you're not repeating yourself. Assuming Commando has similar syntax to vanilla discord.js (it looks like it does), you can do this: