This commit is contained in:
xtaodada 2022-09-03 23:04:28 +08:00
parent 2c259856fa
commit 51403b3604
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 3 additions and 3 deletions

View File

@ -3,10 +3,10 @@ from ci import sqlite
import time
async def refresh_player(uid: str) -> str:
async def refresh_player(uid: str, force=False) -> str:
data = Player(uid)
data.restore()
if data.time + 60 * 5 > int(time.time()):
if not force and data.time + 60 * 5 > int(time.time()):
return "刷新过快,请稍等一会儿再试"
text = await data.update_char()
if not text:

View File

@ -9,8 +9,8 @@ from gspanel.__utils__ import fetchInitRes
async def refresh_admin_command(_: Client, message: Message):
if message.from_user.id != 347437156:
return
await fetchInitRes()
if len(message.command) == 1:
await fetchInitRes()
return await message.reply("请输入 uid", quote=True)
if not message.command[1].isnumeric():
return await message.reply("请输入正确的 uid", quote=True)