fix
This commit is contained in:
parent
ba5cbfcc68
commit
b8a3fc487d
@ -1,7 +1,6 @@
|
||||
from pyrogram import filters, Client
|
||||
from pyrogram.types import Message
|
||||
from defs.bind import check_bind, get_bind_uid, set_bind, remove_bind
|
||||
from defs.player import Player
|
||||
from defs.bind import check_bind, set_bind, remove_bind
|
||||
from ci import app, me
|
||||
|
||||
|
||||
@ -9,14 +8,7 @@ from ci import app, me
|
||||
async def bind_command(_: Client, message: Message):
|
||||
if len(message.command) == 1:
|
||||
if check_bind(message.from_user.id):
|
||||
uid = get_bind_uid(message.from_user.id)
|
||||
if len(message.command) == 1:
|
||||
if message.command[1].isnumeric():
|
||||
uid = message.command[1]
|
||||
data = Player(uid)
|
||||
data.restore()
|
||||
return await message.reply(f"游戏 uid 为 {uid} 的角色缓存有:\n\n"
|
||||
f"{data.gen_all_char()}", quote=True)
|
||||
return await message.reply(f"使用 `/info [uid(可选)]` 查询角色缓存状态", quote=True)
|
||||
else:
|
||||
return await message.reply(f"请使用 <code>/bind [uid]</code> 绑定游戏 uid", quote=True)
|
||||
if not message.command[1].isdigit():
|
||||
|
20
plugins/info.py
Normal file
20
plugins/info.py
Normal file
@ -0,0 +1,20 @@
|
||||
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 check_bind(message.from_user.id):
|
||||
uid = get_bind_uid(message.from_user.id)
|
||||
if len(message.command) == 1:
|
||||
if message.command[1].isnumeric():
|
||||
uid = message.command[1]
|
||||
data = Player(uid)
|
||||
data.restore()
|
||||
return await message.reply(f"游戏 uid 为 {uid} 的角色缓存有:\n\n"
|
||||
f"{data.gen_all_char()}", quote=True)
|
||||
else:
|
||||
return await message.reply(f"请使用 <code>/bind [uid]</code> 绑定游戏 uid", quote=True)
|
Loading…
Reference in New Issue
Block a user