Answers for "discord js change activity"

1

Automatic activity changer discord.js

const activities_list = [
    "Activity 1", 
    "2",
    "3", 
    "4" // You can also add more activities using , after "4"
    ]; 

bot.on('ready', () => {
    setInterval(() => {
        const index = Math.floor(Math.random() * (activities_list.length - 1) + 1); 
        bot.user.setActivity(activities_list[index]); 
    }, 3000); // How fast it changes (milliseconds)
});
Posted by: Guest on March-01-2021

Browse Popular Code Answers by Language