Grenade Visuals
Grenade Visuals

Reputation: 11

How do i mention a member when they say a certain command?

I'm trying to make the bot say "Hey (user) here is a download link for hxd" Can anyone help me?

async def hxd(ctx):
  await client.say('Here is a download link for hxd')

Upvotes: 1

Views: 50

Answers (2)

MrSpaar
MrSpaar

Reputation: 3994

Every discord.Member object has a mention attribute.
Here's how you use it:

@client.command()
async def hxd(ctx):
  await client.say(f"Hey {ctx.author.mention}! Here's a download link for hxd")

Upvotes: 2

Red
Red

Reputation: 27577

You can use getpass.getuser():

from getpass import getuser
async def hxd(ctx):
  await client.say(f'Hey {getuser()} here is a download link for hxd')

Upvotes: -1

Related Questions