天气支持私聊

This commit is contained in:
liuwei
2025-05-26 11:08:30 +08:00
parent ec92d4218c
commit f6257291d8

View File

@@ -81,11 +81,7 @@ class WeatherPlugin(MessagePluginInterface):
return False
content = str(message.get("content", "")).strip()
roomid = message.get("roomid", "")
# 只处理群消息且包含"天气"的消息
if not roomid:
return False
if content.startswith("天气") or content.endswith("天气"):
return True
command = content.split(" ")[0]
@@ -103,7 +99,7 @@ class WeatherPlugin(MessagePluginInterface):
bot: WechatAPIClient = message.get("bot")
# 检查权限
if roomid and gbm.get_group_permission(roomid, Feature.WEATHER) == PermissionStatus.DISABLED:
if gbm.get_group_permission(roomid, Feature.WEATHER) == PermissionStatus.DISABLED:
return False, "没有权限"
# 处理消息内容 - 不再使用jieba分词