mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-11 06:39:59 +08:00
bugfix:修复notice事件扩散问题 (#2132)
* bugfix:修复notice事件扩散问题 * 优化并发调度 * bugfix:修复签到样式 * bugfix:功能调用统计修复 * bugfix:修复私聊时功能调用统计显示已退群问题 * 提高插件适配兼容性 * 优化发送队列 * 修改权限检查设计 * 继续修改权限检查设计 * 完善权限检查设计 * 优化sqlite配置 * 优化数据库初始化 * 代码整理,无用代码清理 * bugfix:修复启动时数据库校验问题 * bugfix:修复预算裁剪过于激进问题
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from nonebot.adapters import Event
|
||||
from nonebot_plugin_uninfo import Uninfo
|
||||
|
||||
from .auth.auth_admin import auth_admin
|
||||
from .auth.auth_bot import auth_bot
|
||||
from .auth.auth_group import auth_group
|
||||
from .auth.auth_plugin import auth_plugin
|
||||
from .auth_types import AuthPreparation
|
||||
|
||||
|
||||
async def legacy_pure_auth_fallback(
|
||||
*,
|
||||
prep: AuthPreparation,
|
||||
event: Event,
|
||||
session: Uninfo,
|
||||
text: str,
|
||||
) -> None:
|
||||
"""Compatibility fallback for cache-deferred pure permission checks."""
|
||||
|
||||
await auth_bot(
|
||||
prep.plugin,
|
||||
prep.snapshot.context.bot_id,
|
||||
prep.snapshot.bot_data,
|
||||
skip_fetch=prep.snapshot.bot_data is not None,
|
||||
allow_sleep_bypass=prep.policy_context.allow_sleep_bypass,
|
||||
context=prep.permission_context,
|
||||
)
|
||||
await auth_group(
|
||||
prep.plugin,
|
||||
prep.snapshot.group,
|
||||
text,
|
||||
prep.snapshot.group_id,
|
||||
context=prep.permission_context,
|
||||
)
|
||||
await auth_plugin(
|
||||
prep.plugin,
|
||||
prep.snapshot.group,
|
||||
session,
|
||||
event,
|
||||
context=prep.permission_context,
|
||||
user_id=prep.snapshot.user_id,
|
||||
)
|
||||
await auth_admin(
|
||||
prep.plugin,
|
||||
session,
|
||||
cached_levels=prep.snapshot.admin_levels,
|
||||
context=prep.permission_context,
|
||||
entity=prep.snapshot.context.entity,
|
||||
)
|
||||
|
||||
|
||||
__all__ = ["legacy_pure_auth_fallback"]
|
||||
Reference in New Issue
Block a user