mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🐛 修复ban检测
This commit is contained in:
parent
3054fddaf3
commit
2f0402b89e
@ -30,11 +30,7 @@ async def is_ban(user_id: str | None, group_id: str | None) -> int:
|
|||||||
if not results:
|
if not results:
|
||||||
return 0
|
return 0
|
||||||
for result in results:
|
for result in results:
|
||||||
if result.group_id == group_id and (
|
if result.duration > 0 or result.duration == -1:
|
||||||
result.duration > 0 or result.duration == -1
|
|
||||||
):
|
|
||||||
return await BanConsole.check_ban_time(user_id, group_id)
|
|
||||||
if not result.group_id and result.duration == -1:
|
|
||||||
return await BanConsole.check_ban_time(user_id, group_id)
|
return await BanConsole.check_ban_time(user_id, group_id)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@ -151,9 +151,9 @@ async def auth(
|
|||||||
raise PermissionExemption("Matcher插件名称不存在...")
|
raise PermissionExemption("Matcher插件名称不存在...")
|
||||||
plugin, user = await get_plugin_and_user(module, entity.user_id)
|
plugin, user = await get_plugin_and_user(module, entity.user_id)
|
||||||
cost_gold = await get_plugin_cost(bot, user, plugin, session)
|
cost_gold = await get_plugin_cost(bot, user, plugin, session)
|
||||||
|
bot_filter(session)
|
||||||
await asyncio.gather(
|
await asyncio.gather(
|
||||||
*[
|
*[
|
||||||
bot_filter(session),
|
|
||||||
auth_ban(matcher, bot, session),
|
auth_ban(matcher, bot, session),
|
||||||
auth_bot(plugin, bot.self_id),
|
auth_bot(plugin, bot.self_id),
|
||||||
auth_group(plugin, entity, message),
|
auth_group(plugin, entity, message),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user