mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-24 05:30:08 +08:00
@@ -52,6 +52,8 @@ class PluginInfo(Model):
|
||||
"""父插件"""
|
||||
is_show = fields.BooleanField(default=True, description="是否显示在帮助中")
|
||||
"""是否显示在帮助中"""
|
||||
impression = fields.FloatField(default=0, description="插件好感度限制")
|
||||
"""插件好感度限制"""
|
||||
|
||||
class Meta: # pyright: ignore [reportIncompatibleVariableOverride]
|
||||
table = "plugin_info"
|
||||
@@ -87,4 +89,5 @@ class PluginInfo(Model):
|
||||
"ALTER TABLE plugin_info ADD COLUMN parent character varying(255);",
|
||||
"ALTER TABLE plugin_info ADD COLUMN is_show boolean DEFAULT true;",
|
||||
"ALTER TABLE plugin_info ADD COLUMN ignore_prompt boolean DEFAULT false;",
|
||||
"ALTER TABLE plugin_info ADD COLUMN impression float DEFAULT 0;",
|
||||
]
|
||||
|
||||
@@ -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