🎈 auto fixes by pre-commit hooks

This commit is contained in:
pre-commit-ci[bot]
2025-03-11 00:55:00 +00:00
parent ad106a27f3
commit 7c5c8e4e0d
3 changed files with 11 additions and 3 deletions
@@ -51,7 +51,10 @@ class WhitelistCheckStage(Stage):
and event.get_message_type() == MessageType.FRIEND_MESSAGE
):
return
if event.unified_msg_origin not in self.whitelist and event.get_group_id() not in self.whitelist:
if (
event.unified_msg_origin not in self.whitelist
and event.get_group_id() not in self.whitelist
):
if self.wl_log:
logger.info(
f"会话 ID {event.unified_msg_origin} 不在会话白名单中,已终止事件传播。请在配置文件中添加该会话 ID 到白名单。"
@@ -335,7 +335,9 @@ class SimpleGewechatClient:
if json_blob["ret"] != 200:
error_msg = json_blob.get("data", {}).get("msg", "")
if "设备不存在" in error_msg:
logger.error(f"检测到无效的appid: {self.appid},将清除并重新登录。")
logger.error(
f"检测到无效的appid: {self.appid},将清除并重新登录。"
)
sp.put(f"gewechat-appid-{self.nickname}", "")
self.appid = None
return await self.login()
+4 -1
View File
@@ -268,7 +268,10 @@ class Main(star.Star):
UID: {user_id} 此 ID 可用于设置管理员。
/op <UID> 授权管理员, /deop <UID> 取消管理员。"""
if self.context.get_config()["platform_settings"]["unique_session"] and event.get_group_id():
if (
self.context.get_config()["platform_settings"]["unique_session"]
and event.get_group_id()
):
ret += f"\n\n当前处于独立会话模式, 此群 ID: {event.get_group_id()}, 也可将此 ID 加入白名单来放行整个群聊。"
event.set_result(MessageEventResult().message(ret).use_t2i(False))