diff --git a/apps/bot/src/config.ts b/apps/bot/src/config.ts index 25d1629..a7df7e7 100644 --- a/apps/bot/src/config.ts +++ b/apps/bot/src/config.ts @@ -9,6 +9,9 @@ export const config = { clientId: process.env.DISCORD_CLIENT_ID ?? "", apiBaseUrl: process.env.APP_URL ?? "http://localhost:3000", webhookSecret: process.env.INTERNAL_WEBHOOK_SECRET ?? "", + // Custom-status text shown under the bot in the member list (global to the + // bot). Override via BOT_ACTIVITY; empty string disables it. + activity: process.env.BOT_ACTIVITY ?? "📋 forms.msk-scripts.de", }; /** diff --git a/apps/bot/src/index.ts b/apps/bot/src/index.ts index 8705478..a0eeda8 100644 --- a/apps/bot/src/index.ts +++ b/apps/bot/src/index.ts @@ -1,4 +1,4 @@ -import { Client, Events, GatewayIntentBits, MessageFlags } from "discord.js"; +import { ActivityType, Client, Events, GatewayIntentBits, MessageFlags } from "discord.js"; import { registerCommands } from "./commands.js"; import { assertConfig, config } from "./config.js"; @@ -21,6 +21,13 @@ export function createClient(): Client { client.once(Events.ClientReady, async (c) => { console.info(`[bot] Logged in as ${c.user.tag} — ${c.guilds.cache.size} guild(s).`); + // Member-list subtitle (custom status). Global to the bot; configurable via BOT_ACTIVITY. + if (config.activity) { + c.user.setPresence({ + status: "online", + activities: [{ name: "MSK Forms", type: ActivityType.Custom, state: config.activity }], + }); + } await syncAllGuilds(c); // Drain the outbox now, then poll on an interval. void deliverPendingNotifications(c);