需求:1.加入了用户积分表;2.加入了指令积分扣除功能;3.加入了积分获得与扣除注解。

This commit is contained in:
liuwei
2025-04-09 11:54:03 +08:00
parent 9b8e0c3558
commit dba9c31504
31 changed files with 1435 additions and 527 deletions

View File

@@ -22,17 +22,16 @@ from base.func_xinghuo_web import XinghuoWeb
from base.func_claude import Claude
from configuration import Config
from constants import ChatType
from game_task.game_task_encyclopedia import game_process_message, get_group_ids, run_random_task_assignment
from message_storage.message_to_db import MessageStorage
from utils.wechat.message_to_db import MessageStorage
from plugin_common.event_system import EventType, EventSystem
from plugin_common.message_plugin_interface import MessagePluginInterface
from plugin_common.plugin_interface import PluginStatus
from plugin_common.plugin_manager import PluginManager
from plugin_common.plugin_registry import PluginRegistry
from robot_cmd.robot_command import GroupBotManager
from utils.robot_cmd.robot_command import GroupBotManager
from job_mgmt import Job
from robot_cmd.robot_command import Feature
from robot_cmd.robot_command import PermissionStatus
from utils.robot_cmd.robot_command import Feature
from utils.robot_cmd.robot_command import PermissionStatus
__version__ = "39.2.4.0"
@@ -243,26 +242,6 @@ class Robot(Job):
except Exception as e:
self.LOG.error(f"revoke_receive_message error: {e}")
# 兼容不@ 直接/触发指令,回答问题。
try:
if msg.content.startswith("/"):
# 进行权限判断 加入权限防止tokens浪费
if self.gbm.get_group_permission(msg.roomid, Feature.TASK_GAME) == PermissionStatus.DISABLED:
return
else:
# 因为内容中存在空格指令,所以不能使用
self.LOG.info(f"msg.content:{msg.content}\n game_message: {msg.content}")
resp = game_process_message(group_id=msg.roomid, player_id=msg.sender, message=msg.content,
player_name=self.allContacts.get(msg.sender, msg.sender))
message = resp["message"]
player_id = resp["player_id"]
print(f"消息: {message}")
print(f"玩家ID: {player_id}")
self.send_text_msg(message, msg.roomid, msg.sender)
return
except Exception as e:
self.LOG.error(f"game_message_load error{e}")
if msg.is_at(self.wxid): # 被@
self.toAt(msg)
return # 处理完群聊信息,后面就不需要处理了
@@ -511,21 +490,21 @@ class Robot(Job):
self.send_text_msg(output, r)
except Exception as e:
self.LOG.error(f"SendRanking error{e}")
# 设置定时任务
def game_auto_tasks(self):
try:
group_ids = get_group_ids()
for gid in group_ids:
if self.gbm.get_group_permission(gid, Feature.TASK_GAME) == PermissionStatus.ENABLED:
rep = run_random_task_assignment(group_id=gid)
message = rep["message"]
player_id = rep["player_id"]
print(f"消息: {message}")
print(f"玩家ID: {player_id}")
self.send_text_msg(message, gid, player_id)
except Exception as e:
self.LOG.error(f"message_summary_robot error{e}")
#
# # 设置定时任务
# def game_auto_tasks(self):
# try:
# group_ids = get_group_ids()
# for gid in group_ids:
# if self.gbm.get_group_permission(gid, Feature.TASK_GAME) == PermissionStatus.ENABLED:
# rep = run_random_task_assignment(group_id=gid)
# message = rep["message"]
# player_id = rep["player_id"]
# print(f"消息: {message}")
# print(f"玩家ID: {player_id}")
# self.send_text_msg(message, gid, player_id)
# except Exception as e:
# self.LOG.error(f"message_summary_robot error{e}")
def xiu_ren_download_task(self):
try: