Looking for help with this discord.js code I have. Currently, when someone runs the command "!cat", it sends a random image from r/cats. Here is the snippet:
var Discord = require('discord.js');
var bot = new Discord.Client()
randomPuppy = require('random-puppy')
bot.on('ready', function() {
console.log(bot.user.username);
});
bot.on('message', async message => {
if (message.content === "!cat") {
const img = await randomPuppy('cats')
message.channel.send(img);
}
});
My goal is to have it send this every 20 minutes instead of waiting for a user's input. I've tried a few methods but they don't seem to work in an asynchronous manner. Any help would be greatly appreciated!