mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 00:32:06 +08:00
🎨 代码优化
This commit is contained in:
@@ -85,7 +85,7 @@ async def _():
|
||||
logger.debug("自动更新群组成员信息成功...")
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
f"Bot: {bot.self_id} 自动更新群组成员信息成功",
|
||||
f"Bot: {bot.self_id} 自动更新群组成员信息失败",
|
||||
target=group.group_id,
|
||||
e=e,
|
||||
)
|
||||
|
||||
@@ -105,6 +105,13 @@ class MemberUpdateManage:
|
||||
),
|
||||
"%Y-%m-%d %H:%M:%S",
|
||||
)
|
||||
cnt = await GroupInfoUser.filter(
|
||||
user_id=str(user_id), group_id=group_id
|
||||
).count()
|
||||
if cnt > 1:
|
||||
await GroupInfoUser.filter(
|
||||
user_id=str(user_id), group_id=group_id
|
||||
).delete()
|
||||
await GroupInfoUser.update_or_create(
|
||||
user_id=str(user_id),
|
||||
group_id=group_id,
|
||||
|
||||
@@ -71,6 +71,8 @@ async def _(matcher: Matcher, bot: Bot, session: EventSession, state: T_State):
|
||||
extra = metadata.extra
|
||||
if extra.get("plugin_type") == PluginType.HIDDEN:
|
||||
return
|
||||
else:
|
||||
return
|
||||
user_id = session.id1
|
||||
group_id = session.id3 or session.id2
|
||||
malicious_ban_time = Config.get_config("hook", "MALICIOUS_BAN_TIME")
|
||||
|
||||
Reference in New Issue
Block a user