From 6a94dc80ee24485def099257e27ffbfb9e1fb7e0 Mon Sep 17 00:00:00 2001 From: Xtao_dada Date: Sun, 17 May 2020 11:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E4=BF=AE=E6=94=B9=20userid=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagermaid/modules/message.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pagermaid/modules/message.py b/pagermaid/modules/message.py index faa22ea..a7f3162 100644 --- a/pagermaid/modules/message.py +++ b/pagermaid/modules/message.py @@ -17,14 +17,14 @@ async def userid(context): """ Query the UserID of the sender of the message you replied to. """ message = await context.get_reply_message() if message: - user_id = message.sender.id - if message.sender.username: - target = "@" + message.sender.username - else: - try: - target = "**" + message.sender.first_name + "**" - except TypeError: - target = "**" + "死号" + "**" + user_id = message.sender.id + if message.sender.username: + target = "@" + message.sender.username + else: + try: + target = "**" + message.sender.first_name + "**" + except TypeError: + target = "**" + "死号" + "**" if not message.forward: await context.edit( f"**以下是被回复消息的信息** \n\n**道纹:** {target} \n"