feat:移除mood,但是加入mood_api
This commit is contained in:
@@ -19,6 +19,7 @@ from src.plugin_system.apis import (
|
||||
send_api,
|
||||
tool_api,
|
||||
frequency_api,
|
||||
mood_api,
|
||||
)
|
||||
from .logging_api import get_logger
|
||||
from .plugin_register_api import register_plugin
|
||||
@@ -40,4 +41,5 @@ __all__ = [
|
||||
"register_plugin",
|
||||
"tool_api",
|
||||
"frequency_api",
|
||||
"mood_api",
|
||||
]
|
||||
|
||||
16
src/plugin_system/apis/mood_api.py
Normal file
16
src/plugin_system/apis/mood_api.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import asyncio
|
||||
import traceback
|
||||
import time
|
||||
from typing import Optional, Union, Dict, List, TYPE_CHECKING, Tuple
|
||||
|
||||
from src.chat.message_receive import message
|
||||
from src.common.logger import get_logger
|
||||
from src.mood.mood_manager import mood_manager
|
||||
|
||||
logger = get_logger("mood_api")
|
||||
|
||||
|
||||
async def get_mood_by_chat_id(chat_id: str) -> Optional[float]:
|
||||
chat_mood = mood_manager.get_mood_by_chat_id(chat_id)
|
||||
mood = asyncio.create_task(chat_mood.get_mood())
|
||||
return mood
|
||||
Reference in New Issue
Block a user