E
E
Egor2021-09-21 12:59:27
Python
Egor, 2021-09-21 12:59:27

Why does the script for a random response from the bot to the discord not work?

@client.command( pass_context = True )

async def sry ( ctx ):
    answer_bot = ["прощаю", "не прощаю"]
    author =  ctx.message.author
    await ctx.send( f"{author.mention}" + random.randrange(answer_bot))
    trueAnswers = 0
    if answer_bot == "прощаю":
        trueAnswers + 1
        await ctx.send(trueAnswers +"/3")
    elif answer_bot == "не прощаю":
        trueAnswers - 1
        await ctx.send(trueAnswers +"/3")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-09-21
@dmtrrr

random.choice(answer_bot)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question