N
N
NoyneimRusskiy552021-01-17 09:54:28
Python
NoyneimRusskiy55, 2021-01-17 09:54:28

I don’t know how to write a discord bot, what should I do?

I'm writing code for a discord bot. I wanted to make it so that when writing! I participate, the author of the message entered into the List, and then when writing the team, 10 people were randomly selected so that 5 people were randomly in one team, 5 others in another, so that the bot wrote their nicknames and gave out a special role, But apparently I don't have enough experience. Thanks in advance to everyone who helps!

List = []


@bot.command()
async def Участвую(ctx):

    author = ctx.message.author
    List.append(author)

    await ctx.send(f'Участвует {author.mention}!')



@bot.command()
async def Ладдер(ctx):


    one = random.choice(List)
    two = random.choice(List)
    three = random.choice(List)
    four = random.choice(List)
    five = random.choice(List)


    ctx.send(one.mention, two.mention,three.mention, four.mention, five.mention)

    six = random.choice(List)
    seven = random.choice(List)
    vosem = random.choice(List)
    devyat = random.choice(List)
    desyat = random.choice(List)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question