天气支持私聊
This commit is contained in:
@@ -95,11 +95,10 @@ class WeatherPlugin(MessagePluginInterface):
|
||||
self.LOG.debug(f"插件执行: {self.name}:{content}")
|
||||
sender = message.get("sender")
|
||||
roomid = message.get("roomid", "")
|
||||
gbm: GroupBotManager = message.get("gbm")
|
||||
bot: WechatAPIClient = message.get("bot")
|
||||
|
||||
# 检查权限
|
||||
if gbm.get_group_permission(roomid, Feature.WEATHER) == PermissionStatus.DISABLED:
|
||||
if GroupBotManager.get_group_permission(roomid, Feature.WEATHER) == PermissionStatus.DISABLED:
|
||||
return False, "没有权限"
|
||||
|
||||
# 处理消息内容 - 不再使用jieba分词
|
||||
|
||||
@@ -189,14 +189,14 @@ def plugin_points_cost(points: int, description: str = None, feature: Feature =
|
||||
# 检查权限
|
||||
roomid = message.get("roomid", "")
|
||||
if feature and roomid:
|
||||
gbm = message.get("gbm")
|
||||
if gbm and gbm.get_group_permission(roomid, feature) == PermissionStatus.DISABLED:
|
||||
if GroupBotManager.get_group_permission(roomid, feature) == PermissionStatus.DISABLED:
|
||||
return False, "没有权限"
|
||||
|
||||
# 检查是否开启了积分获取功能
|
||||
if gbm and gbm.get_group_permission(roomid,
|
||||
Feature.SIGNIN) == PermissionStatus.DISABLED and gbm.get_group_permission(
|
||||
roomid, Feature.TASK_GAME) == PermissionStatus.DISABLED:
|
||||
if (GroupBotManager.get_group_permission(roomid,
|
||||
Feature.SIGNIN) == PermissionStatus.DISABLED
|
||||
and GroupBotManager.get_group_permission(
|
||||
roomid, Feature.TASK_GAME) == PermissionStatus.DISABLED):
|
||||
return await func(self, message)
|
||||
|
||||
# 获取消息信息
|
||||
@@ -265,14 +265,14 @@ def plugin_points_cost(points: int, description: str = None, feature: Feature =
|
||||
# 检查权限
|
||||
roomid = message.get("roomid", "")
|
||||
if feature and roomid:
|
||||
gbm = message.get("gbm")
|
||||
if gbm and gbm.get_group_permission(roomid, feature) == PermissionStatus.DISABLED:
|
||||
if GroupBotManager.get_group_permission(roomid, feature) == PermissionStatus.DISABLED:
|
||||
return False, "没有权限"
|
||||
|
||||
# 检查是否开启了积分获取功能
|
||||
if gbm and gbm.get_group_permission(roomid,
|
||||
Feature.SIGNIN) == PermissionStatus.DISABLED and gbm.get_group_permission(
|
||||
roomid, Feature.TASK_GAME) == PermissionStatus.DISABLED:
|
||||
if (GroupBotManager.get_group_permission(roomid,
|
||||
Feature.SIGNIN) == PermissionStatus.DISABLED
|
||||
and GroupBotManager.get_group_permission(
|
||||
roomid, Feature.TASK_GAME) == PermissionStatus.DISABLED):
|
||||
return func(self, message)
|
||||
|
||||
# 获取消息信息
|
||||
|
||||
Reference in New Issue
Block a user