添加猜歌名功能,从API中提取歌曲前奏,然后猜歌名

This commit is contained in:
liuwei
2025-06-03 11:48:01 +08:00
parent 2a5c789412
commit 833d0005fa

View File

@@ -36,6 +36,7 @@ class GuessSongRedisDB:
"""保存游戏会话数据""" """保存游戏会话数据"""
try: try:
with self.get_redis_connection() as redis_client: with self.get_redis_connection() as redis_client:
logger.info(f"保存猜歌游戏数据{game_data}")
# 设置过期时间为10分钟 # 设置过期时间为10分钟
redis_client.setex( redis_client.setex(
f'{self.prefix}{room_id}', f'{self.prefix}{room_id}',
@@ -110,7 +111,7 @@ class GuessSongPlugin(MessagePluginInterface):
# 保存上下文对象 # 保存上下文对象
self.event_system = context.get("event_system") self.event_system = context.get("event_system")
self.db_manager = context.get("db_manager") self.db_manager = DBConnectionManager.get_instance()
# 初始化Redis操作类 # 初始化Redis操作类
if self.db_manager: if self.db_manager: