😂修复了点数自动重置的问题

This commit is contained in:
EillesWan 2024-07-23 23:44:24 +08:00
parent 86378e2ec0
commit cd85fccedf
3 changed files with 24 additions and 6 deletions

View File

@ -70,8 +70,8 @@ yanlun_path = (
) )
# 每天1点更新 # 每天4点更新
@scheduler.scheduled_job("cron", hour=1) @scheduler.scheduled_job("cron", hour=4)
async def every_day_update(): async def every_day_update():
ulang = Language(get_default_lang_code(), "zh-WY") ulang = Language(get_default_lang_code(), "zh-WY")
nonebot.logger.success(ulang.get("yanlun.refresh.success", COUNT=update_yanlun())) nonebot.logger.success(ulang.get("yanlun.refresh.success", COUNT=update_yanlun()))
@ -282,3 +282,22 @@ async def _(
if (iill := int(final_length)) == final_length if (iill := int(final_length)) == final_length
else await yanlun.finish(UniMessage.text(ulang.get("yanlun.length.float"))) else await yanlun.finish(UniMessage.text(ulang.get("yanlun.length.float")))
) )
time_query = on_alconna(
command=Alconna(
"时间",
),
aliases={"时间查询", "timeq", "timequery"},
)
@time_query.handle()
async def _(
event: T_MessageEvent,
bot: T_Bot,
):
# ulang = get_user_lang(event_utils.get_user_id(event)) # type: ignore
await time_query.finish(
UniMessage.text(zhDateTime.DateTime.now().to_lunar().hanzify())
)

View File

@ -180,7 +180,7 @@ def query_convert_points(
return store, people_convert_point[usr_id][item]["point"] return store, people_convert_point[usr_id][item]["point"]
# 每天1点更新 # 每天4点更新
@scheduler.scheduled_job("cron", hour=4) @scheduler.scheduled_job("cron", hour=4)
async def every_day_update(): async def every_day_update():
# ulang = Language(get_default_lang_code(), "zh-WY") # ulang = Language(get_default_lang_code(), "zh-WY")
@ -238,8 +238,7 @@ async def _():
except: except:
pass pass
if qqid in people_convert_point: query_convert_points(qqid,"music",0,False)
del people_convert_point[qqid]
filesaves[qqid]["totalSize"] -= filesaves[qqid][name]["size"] filesaves[qqid]["totalSize"] -= filesaves[qqid][name]["size"]
nonebot.logger.info( nonebot.logger.info(
"\t删除{}".format(name), "\t删除{}".format(name),