S
S
Soneiko2021-04-01 13:56:16
Python
Soneiko, 2021-04-01 13:56:16

How to make a command with multiple mentions of users?

I'm making a fan team.

@pybot.command()
async def kill(ctx, member: discord.Member = None):   
    await ctx.message.delete()
    load1=discord.Embed(title="Тебя убили", description = f"{ctx.author.mention} заебашил {member.mention}", color=2358184)
        load1.set_author(name = pybot.user.name, icon_url = cap.avatar_url)
        load1.set_image(url = "gif")
        await ctx.channel.send(embed = load1)


The essence is clear, and the team is working. I want to be able to mention 10-20 people at once and all this was recorded in Embed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jerwright, 2021-04-01
@Soneiko

Try changing your function like this:

async def kill(ctx, *member: discord.Member = None):
    #Часть кода...
    for user in member:
        load1=discord.Embed(title="Тебя убили", description = f"{ctx.author.mention} заебашил {user.mention}", color=2358184)
        load1.set_author(name = pybot.user.name, icon_url = cap.avatar_url)
        load1.set_image(url = "gif")
        await ctx.channel.send(embed = load1)

UPD by Vladimir Arshinov

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question