Skip to content

Commit

Permalink
✨ Add dynamic activity rotation in onReady function
Browse files Browse the repository at this point in the history
  • Loading branch information
MotiCAT committed Jan 4, 2024
1 parent 46dd67b commit 67fe3c5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Events/onReady.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,17 @@ export function onReady(client: Client) {
'MB'
// Quote from: https://github.com/Nich87/Faith
});

const activities = ['mc!help Created By CH Products', `${client.guilds.cache.size} Servers | ${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0)} Users`,];

let currentActivityIndex = 0;

setInterval(() => {
const nextActivityIndex = (currentActivityIndex + 1) % activities.length;
const nextActivity = activities[nextActivityIndex];

client.user?.setActivity(nextActivity);

currentActivityIndex = nextActivityIndex;
}, 10000);
}

0 comments on commit 67fe3c5

Please sign in to comment.