Enka_Genshin_bot/plugins/admin.py

19 lines
710 B
Python
Raw Normal View History

2022-06-04 04:32:48 +00:00
from pyrogram import filters, Client
from pyrogram.types import Message
2022-06-04 05:53:53 +00:00
from ci import app
2022-06-04 04:32:48 +00:00
from defs.refresh import refresh_player
2022-06-04 05:53:53 +00:00
@app.on_message(filters.command("refresh_admin") & filters.private)
2022-06-04 05:31:43 +00:00
async def refresh_admin_command(_: Client, message: Message):
2022-06-04 05:53:53 +00:00
if message.from_user.id != 347437156:
2022-06-04 04:32:48 +00:00
return
if len(message.command) == 1:
return await message.reply("请输入 uid", quote=True)
if not message.command[1].isnumeric():
return await message.reply("请输入正确的 uid", quote=True)
uid = message.command[1]
2022-09-02 16:45:18 +00:00
msg = await message.reply("正在刷新数据,请稍等。。。", quote=True)
2022-06-04 04:32:48 +00:00
text = await refresh_player(uid)
await msg.edit(text)