天气支持私聊
This commit is contained in:
@@ -81,11 +81,7 @@ class WeatherPlugin(MessagePluginInterface):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
content = str(message.get("content", "")).strip()
|
content = str(message.get("content", "")).strip()
|
||||||
roomid = message.get("roomid", "")
|
|
||||||
|
|
||||||
# 只处理群消息且包含"天气"的消息
|
|
||||||
if not roomid:
|
|
||||||
return False
|
|
||||||
if content.startswith("天气") or content.endswith("天气"):
|
if content.startswith("天气") or content.endswith("天气"):
|
||||||
return True
|
return True
|
||||||
command = content.split(" ")[0]
|
command = content.split(" ")[0]
|
||||||
@@ -103,7 +99,7 @@ class WeatherPlugin(MessagePluginInterface):
|
|||||||
bot: WechatAPIClient = message.get("bot")
|
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, "没有权限"
|
return False, "没有权限"
|
||||||
|
|
||||||
# 处理消息内容 - 不再使用jieba分词
|
# 处理消息内容 - 不再使用jieba分词
|
||||||
|
|||||||
Reference in New Issue
Block a user