diff --git a/point_trade/main.py b/point_trade/main.py index f4c3d8c..aa5fe56 100644 --- a/point_trade/main.py +++ b/point_trade/main.py @@ -4,7 +4,7 @@ from datetime import datetime from wcferry import Wcf, WxMsg -from robot_cmd.robot_command import GroupBotManager +from robot_cmd.robot_command import GroupBotManager, Feature, PermissionStatus import xml.etree.ElementTree as ET @@ -78,6 +78,10 @@ class PointTrade: self.wcf.send_text(f"-----Bot-----\n❌命令格式错误!{self.command_format}", (message.roomid if message.from_group() else message.sender), message.sender) return + + if self.gbm.get_group_permission(message.roomid, Feature.POINT_TRADE) == PermissionStatus.DISABLED: + return + if not command[1].isdigit(): self.wcf.send_text(f"-----Bot-----\n🈚️转账积分无效(必须为正整数!) \n{self.command_format}", (message.roomid if message.from_group() else message.sender), message.sender) diff --git a/robot_cmd/robot_command.py b/robot_cmd/robot_command.py index 45689bb..e8e746e 100644 --- a/robot_cmd/robot_command.py +++ b/robot_cmd/robot_command.py @@ -33,6 +33,7 @@ class Feature(Enum): TASK_GAME = 9, "百科答题游戏" MUSIC = 10, "点歌功能" SIGNIN = 11, "签到功能" + POINT_TRADE = 12, "积分赠送功能" def __new__(cls, value, description): obj = object.__new__(cls)