Files
d4rkbot/src/bot/presence.js
T
D4rkst3randClaude Fable 5 e72e6c8991 Community-Endgame: Alpha-Keys, Bewerbungen, Events, Stats, Triggers, /remind, Social, Temp-Voice + MEE6-Bot-Karte
- Alpha-Keys: Pool im Community-Tab, Ein-Klick-Verteilung per DM an alle Playtester
  (Key bleibt frei, wenn die DM geblockt wird)
- Bewerbungs-Formulare: Builder im neuen Bewerbungen-Tab (bis 5 Fragen),
  Button → Discord-Modal → Review-Embed mit /, Rolle + DM bei Entscheidung
- Events: GuildScheduledEventCreate → Announce-Embed; öffentliche /events-Seite
  aus den Discord-Events (5-min-Cache)
- Server-Stats: activity_daily (Nachrichten/Joins/Leaves) → Balken-Chart auf /level
- Triggers (Auto-Antworten, 30s-Cooldown), /remind (DM-Scheduler),
  Twitch-Live (Helix, App-Creds write-only) + YouTube-RSS-Announcements,
  Temp-Voice (Join to Create, Cleanup bei Leerstand + Start)
- Brand-Tab: MEE6-Style Bot-Identity-Karte (Avatar-Vorschau mit Status-Dot,
  Bot-Name via setUsername, Presence online/idle/dnd, Aktivität)
- Neue Intents: GuildVoiceStates, GuildScheduledEvents; alles smoke-getestet

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-30 01:02:47 +02:00

31 lines
1.1 KiB
JavaScript

// Bot-Status (Presence) aus den Branding-Settings — hat Vorrang vor dem
// Server-Monitor (der die Presence nur nutzt, wenn hier kein Text gesetzt ist).
import { ActivityType, Events } from 'discord.js';
import { botStatusText, botStatusType, botPresenceStatus } from '../runtime-settings.js';
const TYPES = {
playing: ActivityType.Playing,
watching: ActivityType.Watching,
listening: ActivityType.Listening,
custom: ActivityType.Custom,
};
/** Presence aus den Settings anwenden (Status immer, Aktivität nur wenn Text gesetzt) */
export function applyBotStatus(client) {
const text = botStatusText();
try {
client.user?.setPresence?.({
status: botPresenceStatus(),
activities: text
? [{ name: text, type: TYPES[botStatusType()] ?? ActivityType.Custom }]
: [],
});
} catch (error) {
console.error('[presence] Status setzen fehlgeschlagen:', error.message);
}
}
export function registerPresence(client) {
client.once(Events.ClientReady, () => applyBotStatus(client));
}