📜  自动活动更改器 discord.js - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:41.208000             🧑  作者: Mango

代码示例1
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)
});