如何ping在discord python中启动命令的用户?

如何ping在discord python中启动命令的用户?,python,python-3.x,discord,discord.py-rewrite,Python,Python 3.x,Discord,Discord.py Rewrite,我正在尝试让我的discord bot ping启动命令的用户。 例如,如果用户使用命令“me”,则bot应该只是简单地标记用户自己 到目前为止,我尝试的是: 等待ctx.send(discord.Member.display\u name) 它只返回了 属性对象位置 提前感谢。等待ctx。发送(discord.Member.display\u name)将在服务器上显示成员的display\u name(也称昵称)。提到某人,你可以试试这个: @bot.command() async def

我正在尝试让我的discord bot ping启动命令的用户。 例如,如果用户使用命令“me”,则bot应该只是简单地标记用户自己

到目前为止,我尝试的是:
等待ctx.send(discord.Member.display\u name)

它只返回了 属性对象位置

提前感谢。

等待ctx。发送(discord.Member.display\u name)
将在服务器上显示成员的
display\u name
(也称昵称)。提到某人,你可以试试这个:

@bot.command()
async def mention(ctx):
    await ctx.send(ctx.author.mention)
wait ctx.send(discord.Member.display\u name)
将在服务器上显示成员的
display\u name
。提到某人,你可以试试这个:

@bot.command()
async def mention(ctx):
    await ctx.send(ctx.author.mention)

要提到命令的作者,您可以尝试-
wait ctx.send(提到f'{ctx.author.ention}')
要提到命令的作者,您可以尝试-
wait ctx.send(提到f'{ctx.author.ention}')