Skip to content

Commit

Permalink
🐛 修复admin_check
Browse files Browse the repository at this point in the history
  • Loading branch information
HibiKier committed Oct 22, 2024
1 parent 23ea213 commit b6611d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ NICKNAME=["真寻", "小真寻", "绪山真寻", "小寻子"]

SESSION_EXPIRE_TIMEOUT=30

ALCONNA_USE_COMMAND_START=True

# 全局图片统一使用bytes发送,当真寻与协议端不在同一服务器上时为True
IMAGE_TO_BYTES = False
IMAGE_TO_BYTES = True

# 回复消息时自称
SELF_NICKNAME="小真寻"

# 官bot appid:bot账号
QBOT_ID_DATA = '{

}'

# 数据库配置
# 示例: "postgres://user:[email protected]:5432/database"
# 示例: "mysql://user:[email protected]:3306/database"
Expand Down
4 changes: 2 additions & 2 deletions zhenxun/utils/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ async def _rule(bot: Bot, event: Event, session: Uninfo) -> bool:
if PlatformUtils.is_qbot(session):
"""官bot接口,放弃所有权限检查"""
return False
if session.id and session.group:
if session.group:
level = a
if isinstance(a, str) and key:
level = Config.get_config(a, key)
if level is not None:
return bool(
await LevelUser.check_level(
session.id, session.group.id, int(level)
session.user.id, session.group.id, int(level)
)
)
return False
Expand Down

0 comments on commit b6611d6

Please sign in to comment.