From 2b79410d0ebd6c48c625dd0fa0e430790f08adf7 Mon Sep 17 00:00:00 2001 From: HewkawAr Date: Sun, 11 Aug 2024 09:00:25 +0700 Subject: [PATCH] Update ready.js Add loop to set Activivty --- events/ready.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/events/ready.js b/events/ready.js index a2992c3..b464a96 100644 --- a/events/ready.js +++ b/events/ready.js @@ -12,11 +12,25 @@ module.exports = { * @param {import("discord.js").Client} client - The Discord client. */ async execute(client) { + let currentStatus = 0; + function setActivity() { + const status = [ + `🌟 /help | V${version}`, + `🎷 Playing in ${client.moon.players.cache.size} Servers`, + "🎵 /play to play song", + ]; + client.user.setActivity({ - name: `/help | V${version}`, + name: status[currentStatus], type: ActivityType.Custom }); + + if (currentStatus >= status.length - 1) { + currentStatus = 0; + } else { + currentStatus++; + } } setActivity(); @@ -24,7 +38,7 @@ module.exports = { console.log(`[${client.shard.ids}] Ready! Logged in as ${client.user.tag}`); console.log(`[${client.shard.ids}] Server Count: ${client.guilds.cache.size.toLocaleString()}`); - setInterval(setActivity, 60 * 1000); + setInterval(setActivity, 5 * 1000); if (mongoDBUrl) { await mongoose.connect(mongoDBUrl);