T
T
toskling2022-04-09 18:04:41
Python
toskling, 2022-04-09 18:04:41

How to make python discord bot accept another message after if?

Part of the problematic code:

if message.content.lower()  ==  'здравствуй':
    message.channel.send('я тебя так долго ждал')
    if message.content.lower() == 'пока':
        message.channel.send('пока')


The problem is that the second condition applies to the first entered message, and I need the second message to be read by the bot after the second condition is met. That is, it is necessary that message.content.lower() in the third line is perceived by the bot as another message. Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-04-09
@toskling

It's not very clear what you want. But you need to decide:
a) Either the sequence of messages is not important for you, then the question is only in formulating the correct conditions.
b) Or the sequence of messages is important for you, then you need to remember for each user where in the sequence he stopped. This information will have to be stored by yourself.
There is, of course, an option with wait_for () (if you have discord.py and not something else), but it is also not easy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question