N
N
NiicKz2021-04-27 13:03:55
Bots
NiicKz, 2021-04-27 13:03:55

How to make the bot mention the one who wrote the command and the one who was mentioned?

I need the bot to mention the person who wrote the command. For example, a person with the nickname ,,table" writes the command !hit @chair, then the bot replies ,,@table hit @chair". How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Nevzorov, 2021-04-27
@NiicKz

@bot.command()
async def slap(ctx, *, who: discord.Member):  # https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html#converters
    await ctx.send(f"{ctx.message.author.mention} slapped {who.mention}")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question