mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-24 05:30:08 +08:00
@@ -36,6 +36,24 @@ class SignUser(Model):
|
||||
table = "sign_users"
|
||||
table_description = "用户签到数据表"
|
||||
|
||||
@classmethod
|
||||
async def get_user(cls, user_id: str, platform: str | None = None) -> "SignUser":
|
||||
"""获取签到用户
|
||||
|
||||
参数:
|
||||
user_id: 用户id
|
||||
platform: 平台.
|
||||
|
||||
返回:
|
||||
Self: SignUser
|
||||
"""
|
||||
user_console = await UserConsole.get_user(user_id, platform)
|
||||
user, _ = await SignUser.get_or_create(
|
||||
user_id=user_id,
|
||||
defaults={"user_console": user_console, "platform": platform},
|
||||
)
|
||||
return user
|
||||
|
||||
@classmethod
|
||||
async def sign(
|
||||
cls,
|
||||
|
||||
Reference in New Issue
Block a user