Finding author of a message

前端 未结 3 581
一生所求
一生所求 2021-01-20 14:49

If someone writes \"?name (arg)\" I want my bot to say the author of the message + \", your name is\" + arg. I can\'t find of the author of the message thou

3条回答
  •  感动是毒
    2021-01-20 15:28

    To get the name of the author of the message, you will need to use context

    @client.command(pass_context=True)
    async def name(ctx):
        username = ctx.message.author.name
        ...
    

提交回复
热议问题