动态auth完成。
This commit is contained in:
@@ -533,7 +533,7 @@ class GameTaskPlugin(MessagePluginInterface):
|
||||
groups = self.encyclopedia_db.get_all_groups()
|
||||
for group in groups:
|
||||
# 检查权限
|
||||
if GroupBotManager.get_group_permission(group, Feature.TASK_GAME) == PermissionStatus.DISABLED:
|
||||
if GroupBotManager.get_group_permission(group,self.feature) == PermissionStatus.DISABLED:
|
||||
continue
|
||||
|
||||
# 获取群内所有玩家
|
||||
|
||||
@@ -263,7 +263,7 @@ class JDTokenPlugin(MessagePluginInterface):
|
||||
return False, "命令格式错误"
|
||||
|
||||
# 检查权限
|
||||
if roomid and gbm.get_group_permission(roomid, Feature.JD_TOKEN) == PermissionStatus.DISABLED:
|
||||
if roomid and gbm.get_group_permission(roomid, self.feature) == PermissionStatus.DISABLED:
|
||||
return False, "没有权限"
|
||||
|
||||
# 提取token和备注
|
||||
|
||||
@@ -100,7 +100,7 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
||||
return True
|
||||
|
||||
@plugin_stats_decorator(plugin_name="群聊总结")
|
||||
@plugin_points_cost(10, "群聊总结消耗积分", Feature.SUMMARY_CAPABILITY)
|
||||
@plugin_points_cost(10, "群聊总结消耗积分", FEATURE_KEY)
|
||||
async def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
|
||||
"""处理消息"""
|
||||
try:
|
||||
@@ -122,7 +122,7 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
||||
return False, None
|
||||
# 权限判断
|
||||
gbm: GroupBotManager = message.get("gbm")
|
||||
if gbm and gbm.get_group_permission(group_id, Feature.SUMMARY_CAPABILITY) == PermissionStatus.DISABLED:
|
||||
if gbm and gbm.get_group_permission(group_id, self.feature) == PermissionStatus.DISABLED:
|
||||
return False, None
|
||||
# 从消息历史中获取群聊记录
|
||||
all_contacts: dict = message.get("all_contacts")
|
||||
|
||||
@@ -149,7 +149,7 @@ class PointTradePlugin(MessagePluginInterface):
|
||||
|
||||
self.revoke: MessageAutoRevoke = message.get("revoke")
|
||||
# 检查权限
|
||||
if roomid and gbm.get_group_permission(roomid, Feature.POINT_TRADE) == PermissionStatus.DISABLED:
|
||||
if roomid and gbm.get_group_permission(roomid, self.feature) == PermissionStatus.DISABLED:
|
||||
return False, "没有权限"
|
||||
|
||||
# 处理不同的命令
|
||||
|
||||
@@ -155,6 +155,7 @@ class RobotMenuPlugin(MessagePluginInterface):
|
||||
self.LOG.debug(f"插件执行: {self.name}:{content}")
|
||||
sender = message.get("sender")
|
||||
roomid = message.get("roomid", "")
|
||||
command = content.split(" ")[0]
|
||||
gbm: GroupBotManager = message.get("gbm")
|
||||
bot: WechatAPIClient = message.get("bot")
|
||||
revoke: MessageAutoRevoke = message.get("revoke")
|
||||
|
||||
Reference in New Issue
Block a user