mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
refactor(zhenxun): 优化 unban 函数返回值类型
- 将 unban 函数的返回类型从 tuple[bool, str | None] 改为 tuple[bool, str] - 修改返回值,确保总是返回字符串类型,避免类型检查错误
This commit is contained in:
parent
c83e15bdaa
commit
453ce09fbf
@ -103,7 +103,7 @@ class BanManage:
|
||||
session: EventSession,
|
||||
idx: int | None = None,
|
||||
is_superuser: bool = False,
|
||||
) -> tuple[bool, str | None]:
|
||||
) -> tuple[bool, str]:
|
||||
"""unban目标用户
|
||||
|
||||
参数:
|
||||
@ -129,7 +129,7 @@ class BanManage:
|
||||
return True, ban_data.user_id or ban_data.group_id
|
||||
elif await BanConsole.check_ban_level(user_id, group_id, user_level):
|
||||
await BanConsole.unban(user_id, group_id)
|
||||
return True, group_id
|
||||
return True, group_id or ""
|
||||
return False, "该用户/群组不在黑名单中不足捏..."
|
||||
|
||||
@classmethod
|
||||
|
||||
Loading…
Reference in New Issue
Block a user