Branding-Tab: Name/Farben/Bot-Status/Avatar/Banner + Button-Farben für Rollen-Menüs
- Alle Embeds nutzen jetzt brandName/brandColor/brandColor2/brandFooter aus den Settings (Codemod über 20 Module) — Farbe & Name serverweit per Klick änderbar - Bot-Status (Presence): Typ (Spielt/Schaut/Hört/Status) + Text, sofort angewendet; Server-Monitor nutzt die Presence nur noch, wenn kein eigener Status gesetzt ist - Avatar-/Banner-Upload direkt aufs Bot-Profil (Base64, 8-MB-Limit, Discord-Rate-Limit sauber gemeldet) - Env-Verlagerung: GITEA_API_TOKEN (write-only Setting) und DISCORD_GUILD_ID jetzt auch über den Brand-Tab pflegbar — weniger Redeploys - Rollen-Menüs: Button-Farbe pro Eintrag wählbar (Grau/Blau/Grün/Rot) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// Bot-Status (Presence) aus den Branding-Settings — hat Vorrang vor dem
|
||||
// Server-Monitor (der die Presence nur nutzt, wenn hier nichts gesetzt ist).
|
||||
import { ActivityType, Events } from 'discord.js';
|
||||
import { botStatusText, botStatusType } from '../runtime-settings.js';
|
||||
|
||||
const TYPES = {
|
||||
playing: ActivityType.Playing,
|
||||
watching: ActivityType.Watching,
|
||||
listening: ActivityType.Listening,
|
||||
custom: ActivityType.Custom,
|
||||
};
|
||||
|
||||
/** Presence aus den Settings anwenden (leerer Text = Presence löschen) */
|
||||
export function applyBotStatus(client) {
|
||||
const text = botStatusText();
|
||||
try {
|
||||
if (!text) {
|
||||
client.user?.setPresence?.({ activities: [] });
|
||||
return;
|
||||
}
|
||||
client.user?.setActivity?.(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));
|
||||
}
|
||||
Reference in New Issue
Block a user