I am using discord.py to make a Discord bot that gives you a complement every 24 hours. To test, I set the timer to 1 second. The code I made looked like this:
const Discord = require('discord.js')
const client = new Discord.Client()
const complements = [
...
]
client.once('ready', () => {
console.log('Logged in!');
client.user.setActivity("with nice complements.")
setInterval(console.log,1000,complements[Math.floor(Math.random() * (complements.length - 1))]);
});
However, this just returns the same complement every time. Is there any ways it can choose a random complement?