RikSantra
RikSantra

Reputation: 59

How to ping the user who initiated a command in discord python?

I'm trying to get my discord bot to ping the user who initiates the command. For example, if the user uses the command 'me', the bot should just simply tag the user himself.

So far what I have tried is: await ctx.send(discord.Member.display_name)

Which only returned the property object location.

Thanks in advance.

Upvotes: 1

Views: 894

Answers (1)

Thundo
Thundo

Reputation: 173

await ctx.send(discord.Member.display_name) will show up the display_name of the member on the server (aka nickname). To mention someone you could try this:

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

Upvotes: 3

Related Questions