🔧 修改 userid 错误逻辑
This commit is contained in:
parent
aa2533dae6
commit
6a94dc80ee
@ -17,14 +17,14 @@ async def userid(context):
|
|||||||
""" Query the UserID of the sender of the message you replied to. """
|
""" Query the UserID of the sender of the message you replied to. """
|
||||||
message = await context.get_reply_message()
|
message = await context.get_reply_message()
|
||||||
if message:
|
if message:
|
||||||
user_id = message.sender.id
|
user_id = message.sender.id
|
||||||
if message.sender.username:
|
if message.sender.username:
|
||||||
target = "@" + message.sender.username
|
target = "@" + message.sender.username
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
target = "**" + message.sender.first_name + "**"
|
target = "**" + message.sender.first_name + "**"
|
||||||
except TypeError:
|
except TypeError:
|
||||||
target = "**" + "死号" + "**"
|
target = "**" + "死号" + "**"
|
||||||
if not message.forward:
|
if not message.forward:
|
||||||
await context.edit(
|
await context.edit(
|
||||||
f"**以下是被回复消息的信息** \n\n**道纹:** {target} \n"
|
f"**以下是被回复消息的信息** \n\n**道纹:** {target} \n"
|
||||||
|
Loading…
Reference in New Issue
Block a user