如何获取用户名Python

时间:2018-06-21 17:16:11

标签: python python-3.x discord discord.py

如何获取带有标记的用户名作为回复。下面的代码在标记示例?hello @Steve

时将Dm发送给用户
@bot.command(pass_context=True)
async def hello(ctx, member: discord.Member):
    await bot.send_message(member, "Hi (username) how are you.")

漫游器回复的Hi Steve how are you.

1 个答案:

答案 0 :(得分:0)

检查User 示例:

await bot.send_message(member, "Hi {} I love ya.".format(member.name))