mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
⚡️ 减少插件限制查询次数 (#1743)
This commit is contained in:
parent
9449316a14
commit
6e740657b6
@ -85,7 +85,7 @@ class LimitManage:
|
|||||||
if group_id and limit.watch_type == LimitWatchType.GROUP:
|
if group_id and limit.watch_type == LimitWatchType.GROUP:
|
||||||
key_type = channel_id or group_id
|
key_type = channel_id or group_id
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"解除对象: {key_type} 的block现在",
|
f"解除对象: {key_type} 的block限制",
|
||||||
"AuthChecker",
|
"AuthChecker",
|
||||||
session=user_id,
|
session=user_id,
|
||||||
group_id=group_id,
|
group_id=group_id,
|
||||||
@ -323,11 +323,12 @@ class AuthChecker:
|
|||||||
if not group_id:
|
if not group_id:
|
||||||
group_id = channel_id
|
group_id = channel_id
|
||||||
channel_id = None
|
channel_id = None
|
||||||
limit_list: list[PluginLimit] = await plugin.plugin_limit.filter(
|
if plugin.module not in LimitManage.add_module:
|
||||||
status=True
|
limit_list: list[PluginLimit] = await plugin.plugin_limit.filter(
|
||||||
).all() # type: ignore
|
status=True
|
||||||
for limit in limit_list:
|
).all() # type: ignore
|
||||||
LimitManage.add_limit(limit)
|
for limit in limit_list:
|
||||||
|
LimitManage.add_limit(limit)
|
||||||
if user_id:
|
if user_id:
|
||||||
await LimitManage.check(
|
await LimitManage.check(
|
||||||
plugin.module, user_id, group_id, channel_id, session
|
plugin.module, user_id, group_id, channel_id, session
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user