如何 ping 在 discord python 中发起命令的用户?
How to ping the user who initiated a command in discord python?
我正在尝试让我的 discord 机器人对启动命令的用户执行 ping 操作。
例如,如果用户使用命令 'me',机器人应该只是简单地标记用户自己。
到目前为止我尝试过的是:
await ctx.send(discord.Member.display_name)
只返回了
属性 对象位置。
提前致谢。
await ctx.send(discord.Member.display_name)
将显示服务器上成员的 display_name
(也称为昵称)。要提及某人,您可以尝试这样做:
@bot.command()
async def mention(ctx):
await ctx.send(ctx.author.mention)
我正在尝试让我的 discord 机器人对启动命令的用户执行 ping 操作。 例如,如果用户使用命令 'me',机器人应该只是简单地标记用户自己。
到目前为止我尝试过的是:
await ctx.send(discord.Member.display_name)
只返回了 属性 对象位置。
提前致谢。
await ctx.send(discord.Member.display_name)
将显示服务器上成员的 display_name
(也称为昵称)。要提及某人,您可以尝试这样做:
@bot.command()
async def mention(ctx):
await ctx.send(ctx.author.mention)