Can someone help me mention the user that ran the command in discord.py?
Go to solution
Solved by remuff,
If you have the context, you can just find the author of the message with ctx.message.author (or just ctx.author since rewrite).
So you can just mention the user with something like the following:
@bot.commmand() async def mention_me(ctx: commands.Context): """Simply mentions the author of the command in a message""" await ctx.send(f"Hello {ctx.author.mention}, your muffins look great today!")
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now