Python 如何让我的discord机器人在py中提及没有ID的人?

Python 如何让我的discord机器人在py中提及没有ID的人?,python,Python,我试过这个,但它只能回答一个特定的人 message.author==client.user: 返回 如果message.content.startswith('slap'): wait message.channel.send(“{0.author.title}slapped.”格式化(消息))我建议使用命令。 如果你这样做,它将是这样的: @commands.command() # This can be whatever you bot variable is async def slap

我试过这个,但它只能回答一个特定的人

message.author==client.user: 返回

如果message.content.startswith('slap'):
wait message.channel.send(“{0.author.title}slapped.”格式化(消息))

我建议使用命令。 如果你这样做,它将是这样的:

@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