diff --git a/bot/api.py b/bot/api.py index 951bcf6..5fb46c5 100644 --- a/bot/api.py +++ b/bot/api.py @@ -1275,9 +1275,13 @@ def status(): mood_name, _ = server_manager.get_server_mood(guild_id) server_moods[str(guild_id)] = mood_name + # Return evil mood when in evil mode + current_mood = globals.EVIL_DM_MOOD if globals.EVIL_MODE else globals.DM_MOOD + return { "status": "online", - "mood": globals.DM_MOOD, + "mood": current_mood, + "evil_mode": globals.EVIL_MODE, "servers": len(server_manager.servers), "active_schedulers": len(server_manager.schedulers), "server_moods": server_moods diff --git a/bot/static/index.html b/bot/static/index.html index b68aad0..f95a36f 100644 --- a/bot/static/index.html +++ b/bot/static/index.html @@ -1806,7 +1806,13 @@ const EVIL_MOOD_EMOJIS = { "aggressive": "ðŋ", "cunning": "ð", "sarcastic": "ð", - "evil_neutral": "" + "evil_neutral": "", + "bored": "ðĨą", + "manic": "ðĪŠ", + "jealous": "ð", + "melancholic": "ð", + "playful_cruel": "ð", + "contemptuous": "ð" }; // Tab switching functionality @@ -2522,10 +2528,17 @@ async function setMood() { async function resetMood() { try { - await apiCall('/mood/reset', 'POST'); - showNotification('Mood reset to neutral'); - currentMood = 'neutral'; - document.getElementById('mood').value = 'neutral'; + if (evilMode) { + await apiCall('/evil-mode/mood', 'POST', { mood: 'evil_neutral' }); + showNotification('Evil mood reset to evil_neutral'); + currentMood = 'evil_neutral'; + document.getElementById('mood').value = 'evil_neutral'; + } else { + await apiCall('/mood/reset', 'POST'); + showNotification('Mood reset to neutral'); + currentMood = 'neutral'; + document.getElementById('mood').value = 'neutral'; + } } catch (error) { console.error('Failed to reset mood:', error); } @@ -2533,8 +2546,15 @@ async function resetMood() { async function calmMiku() { try { - await apiCall('/mood/calm', 'POST'); - showNotification('Miku has been calmed down'); + if (evilMode) { + await apiCall('/evil-mode/mood', 'POST', { mood: 'evil_neutral' }); + showNotification('Evil Miku has been calmed down'); + currentMood = 'evil_neutral'; + document.getElementById('mood').value = 'evil_neutral'; + } else { + await apiCall('/mood/calm', 'POST'); + showNotification('Miku has been calmed down'); + } } catch (error) { console.error('Failed to calm Miku:', error); } @@ -2630,9 +2650,15 @@ function updateEvilModeUI() { // Switch mood dropdown to evil moods moodSelect.innerHTML = ` + + - + + + + + `; } else { body.classList.remove('evil-mode'); @@ -3900,20 +3926,43 @@ async function loadStatus() { const result = await apiCall('/status'); const statusDiv = document.getElementById('status'); + // Sync evil mode state from server (may change via Discord commands) + if (result.evil_mode !== undefined && result.evil_mode !== evilMode) { + evilMode = result.evil_mode; + updateEvilModeUI(); + if (evilMode && result.mood) { + const moodSelect = document.getElementById('mood'); + if (moodSelect) moodSelect.value = result.mood; + } + } + + // Update mood dropdown selection to match current server mood + if (result.mood) { + const moodSelect = document.getElementById('mood'); + if (moodSelect && moodSelect.querySelector(`option[value="${result.mood}"]`)) { + moodSelect.value = result.mood; + } + currentMood = result.mood; + } + let serverMoodsHtml = ''; if (result.server_moods) { serverMoodsHtml = '