我试过了,但它只能回答特定的人
message.author == client.user: 返回
if message.content.startswith('slap <@!479915823897640972>'): 等待 message.channel.send( "{0.author.mention} 拍了 <@!479915823897640972>".format(message))
答案 0 :(得分:0)
我建议使用命令。 如果你这样做,它会是这样的:
@commands.command() # This can be whatever you bot variable is
async def slap(self, ctx, user): # You can change the name to whatever
await ctx.send(f"{ctx.author.mention} slapped {user}") # The only issue is that the user can be anything, from a number to a word, and not always a mention