🔧 修改 userid 错误逻辑

This commit is contained in:
Xtao_dada 2020-05-17 11:21:05 +08:00 committed by GitHub
parent aa2533dae6
commit 6a94dc80ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"