user9818240
user9818240

Reputation:

discord.py client.say @user only using ctx argument

Using:

@client.command(pass_context=True)
async def bla(ctx):

I want to add a await client.say that could @ the user. I have been trying to use the (ctx.message.author)) but the I only got this printed in the Discord server: click here

Code used in image above: await client.say("Bla bla bla! @{}".format(ctx.message.author))

I don't want to add another argument to the async def bla(ctx):

Upvotes: 0

Views: 601

Answers (1)

Patrick Haugh
Patrick Haugh

Reputation: 60994

Use the mention attribute of the author object.

@client.command(pass_context=True)
async def bla(ctx):
    await client.say("Bla bla bla! {}".format(ctx.message.author.mention))

Upvotes: 1

Related Questions