Initial commit: Miku Discord Bot
This commit is contained in:
63
bot/commands/actions.py
Normal file
63
bot/commands/actions.py
Normal file
@@ -0,0 +1,63 @@
|
||||
# commands/actions.py
|
||||
import os
|
||||
import asyncio
|
||||
import globals
|
||||
from utils.moods import load_mood_description
|
||||
from utils.scheduled import send_bedtime_reminder
|
||||
|
||||
|
||||
def set_mood(new_mood: str) -> bool:
|
||||
"""Set mood (legacy function - now handled per-server or DM)"""
|
||||
print("⚠️ set_mood called - this function is deprecated. Use server-specific mood endpoints instead.")
|
||||
return False
|
||||
|
||||
|
||||
def reset_mood() -> str:
|
||||
"""Reset mood to neutral (legacy function - now handled per-server or DM)"""
|
||||
print("⚠️ reset_mood called - this function is deprecated. Use server-specific mood endpoints instead.")
|
||||
return "neutral"
|
||||
|
||||
|
||||
def check_mood():
|
||||
return globals.DM_MOOD
|
||||
|
||||
|
||||
def calm_miku() -> str:
|
||||
"""Calm Miku down (legacy function - now handled per-server or DM)"""
|
||||
print("⚠️ calm_miku called - this function is deprecated. Use server-specific mood endpoints instead.")
|
||||
return "neutral"
|
||||
|
||||
|
||||
def reset_conversation(user_id):
|
||||
globals.conversation_history[str(user_id)].clear()
|
||||
|
||||
|
||||
async def force_sleep() -> str:
|
||||
"""Force Miku to sleep (legacy function - now handled per-server or DM)"""
|
||||
print("⚠️ force_sleep called - this function is deprecated. Use server-specific mood endpoints instead.")
|
||||
return "asleep"
|
||||
|
||||
|
||||
async def wake_up(set_sleep_state=None):
|
||||
reset_mood()
|
||||
# Note: DMs don't have sleep states, so this is deprecated
|
||||
print("⚠️ wake_up called - this function is deprecated. Use server-specific mood endpoints instead.")
|
||||
|
||||
if set_sleep_state:
|
||||
await set_sleep_state(False)
|
||||
|
||||
|
||||
async def send_bedtime_now():
|
||||
await send_bedtime_reminder()
|
||||
|
||||
|
||||
async def update_profile_picture(mood: str = "neutral"):
|
||||
"""Manually trigger a profile picture update"""
|
||||
from utils.profile_picture_manager import update_profile_picture
|
||||
|
||||
try:
|
||||
success = await update_profile_picture(globals.client, mood=mood)
|
||||
return success
|
||||
except Exception as e:
|
||||
print(f"⚠️ Error updating profile picture: {e}")
|
||||
return False
|
||||
Reference in New Issue
Block a user