from pyrogram import filters, Client from pyrogram.types import Message from defs.bind import check_bind, get_bind_uid from ci import app, me from defs.refresh import refresh_player @app.on_message(filters.command(["refresh", f"refresh@{me['result']['username']}"]) & filters.private) async def refresh_command(_: Client, message: Message): if not check_bind(message.from_user.id): return await message.reply("请使用 /bind [uid] 绑定游戏 uid", quote=True) uid = get_bind_uid(message.from_user.id) if len(message.command) > 1 and message.command[1].isnumeric(): uid = message.command[1] msg = await message.reply("正在刷新数据,请稍等。。。", quote=True) text = await refresh_player(uid) await msg.edit(text)