-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathactivityUpdate.ts
More file actions
61 lines (53 loc) · 1.82 KB
/
Copy pathactivityUpdate.ts
File metadata and controls
61 lines (53 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { ActivityType, Events } from "discord.js";
import { DiscordClient } from "../base/types/discord.js";
function getStatus(guilds: number, users: number) {
const statuses = [
`Managing ${guilds} servers!`,
`Watching over ${users} users`,
`Boost, boost, boost!`,
`Keeping communities active`,
`Powering Discord servers`,
`Tracking boosts in real-time`,
`Helping servers grow`,
`Thanking boosters 24/7`,
`Making server management easier`,
`Serving ${guilds} amazing communities 🎉`,
`Keeping the hype alive`,
`Running on caffeine and Node.js ☕`,
`Auto-managing booster perks`,
`Boosters deserve the best`,
`Syncing rewards like magic`,
`Made with TypeScript`,
`Keeping roles in sync`,
`Boosting experiences daily`,
`Listening to slash commands`,
`Managing chaos professionally`,
`Protecting the server vibes`,
`One boost at a time 💜`,
`Currently in ${guilds} servers 🌐`,
`Making Discord better`,
];
return statuses[Math.floor(Math.random() * statuses.length)];
}
export default {
name: Events.ClientReady,
once: true,
execute(client: DiscordClient) {
if (!client.user) return;
const updatePresence = () => {
const guilds = client.guilds.cache.size;
const users = client.guilds.cache.reduce(
(acc, guild) => acc + (guild.memberCount || 0),
0
);
client.user!.setActivity({
type: ActivityType.Custom,
name: getStatus(guilds, users),
});
};
setTimeout(() => {
updatePresence();
setInterval(updatePresence, 1000 * 60 * 60);
}, 3000);
},
};