from pyrogram import filters, Client from pyrogram.types import Message from defs.bind import check_bind, get_bind_uid from defs.player import Player from ci import app, me @app.on_message(filters.command(["info", f"info@{me['result']['username']}"]) & filters.private) async def info_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] data = Player(uid) return await message.reply( f"游戏 uid 为 {uid} 的角色缓存有:\n\n{data.gen_all_char()}", quote=True, ) if data.all_char else await message.reply( "没有可展示的角色,可能是数据未刷新", quote=True, )