Fix AttributeError in get_player_by_swid

This commit is contained in:
Ben 2020-04-02 23:05:05 +01:00
parent 9349b5374b
commit 815f16c008

View File

@ -175,7 +175,7 @@ async def handle_get_player_by_id(p, penguin_id: int):
@handlers.cooldown(1) @handlers.cooldown(1)
async def handle_get_player_by_swid(p, penguin_id: int): async def handle_get_player_by_swid(p, penguin_id: int):
if penguin_id in p.server.penguins_by_id: if penguin_id in p.server.penguins_by_id:
nickname = p.server.penguins_by_id[penguin_id].safe_nick nickname = p.server.penguins_by_id[penguin_id].safe_name
else: else:
nickname = await Penguin.select('nickname').where(Penguin.id == penguin_id).gino.scalar() nickname = await Penguin.select('nickname').where(Penguin.id == penguin_id).gino.scalar()
await p.send_xt('pbs', penguin_id, penguin_id, nickname) await p.send_xt('pbs', penguin_id, penguin_id, nickname)