mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: presence
This commit is contained in:
1 parent
a3e20501af
commit
debaaccf4c
3 files changed
+23
-3
No files matched your search
+20
-2
@@ -1,5 +1,23 @@
|
||||
import { Client } from 'discord.js';
|
||||
import { ActivityType, Client } from 'discord.js';
|
||||
|
||||
export default function ready(client: Client<true>) {
|
||||
console.log(`🟢 Launched bot ${client.shard?.ids[0]}`);
|
||||
console.log(`🟢 Launched bot ${client.shard?.ids[0] ?? 'default'}`);
|
||||
|
||||
const activities: (() => string)[] = [
|
||||
() => `Living in ${client.guilds.cache.size.toLocaleString()} servers`,
|
||||
() =>
|
||||
`Serving ${client.guilds.cache
|
||||
.reduce((accumulator, guild) => accumulator + guild.memberCount, 0)
|
||||
.toLocaleString()} users`,
|
||||
() => `Observing ${client.channels.cache.size.toLocaleString()} channels`,
|
||||
];
|
||||
|
||||
client.user.setPresence({
|
||||
activities: [
|
||||
{
|
||||
type: ActivityType.Custom,
|
||||
name: activities[Math.floor(Math.random() * activities.length)](),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user