diff --git a/src/events/ready.ts b/src/events/ready.ts index 3d4a814..182aa6a 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -1,4 +1,4 @@ -import { Client } from 'discord.js'; +import { ActivityType, Client } from 'discord.js'; import { EventHandler } from '../utils/types'; import { logger } from '../utils/logger'; import { env } from '../config/env'; @@ -11,7 +11,20 @@ const event: EventHandler = { async execute(client: Client) { try { logger.info(`Bot eingeloggt als ${client.user?.tag}`); - client.user?.setPresence({ activities: [{ name: 'Papo | /help', type: 0 }], status: 'online' }); + const website = env.publicBaseUrl || 'https://papo.gg'; + const activities = [ + { name: 'Papo | /help', type: ActivityType.Playing }, + { name: `Dashboard: ${website}`, type: ActivityType.Watching }, + { name: `${client.guilds.cache.size} Guilds verwaltet`, type: ActivityType.Watching } + ]; + let idx = 0; + const applyPresence = () => { + const activity = activities[idx % activities.length]; + client.user?.setPresence({ activities: [activity], status: 'online' }); + idx += 1; + }; + applyPresence(); + setInterval(applyPresence, 60_000); logger.info(`Ready on ${client.guilds.cache.size} Guilds`); // force guild command registration so new commands wie /birthday sofort erscheinen if (context.commandHandler) {