update code

This commit is contained in:
HibiKier
2021-09-05 02:21:38 +08:00
parent 21a5feda43
commit 7afb099c12
84 changed files with 3377 additions and 1404 deletions
+14
View File
@@ -60,6 +60,20 @@ class BanUser(db.Model):
await cls.unban(user_qq)
return False
@classmethod
async def is_super_ban(cls, user_qq: int) -> bool:
"""
说明:
判断用户是否被ban
参数:
:param user_qq: qq号
"""
user = await cls.query.where((cls.user_qq == user_qq)).gino.first()
if not user:
return False
if user.ban_level == 10:
return True
@classmethod
async def ban(cls, user_qq: int, ban_level: int, duration: int) -> bool:
"""