Very new to coding so please be patient. I was wondering if it was possible to sort of nest commands and responses when dealing with a discord bot. For example, you'd use a command to see your options, then the bot would wait for a response to its message and reply accordingly. I'm having a little trouble describing what I mean so here's sort of an example: You ask the bot something The bot gives you options You choose from these options The bot responds to your answer or You ask the bot to do something with what you say next The bot asks you to say something You say something The bot uses what you've said in it's response
I've already tried nesting the on_message command into an already existing if statement but that obviously hasn't worked. I've also tried just adding another if statement, with the whole message.content stuff, hoping the bot would take the message after it's response into consideration.
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith("!ml"):
message.content = message.content.lower().replace(' ', '')
if message.content in command1:
response = "Hello! To start type !ml menu. You will be given your options. Don't forget to type !ml before " \
"everything you tell me, so I know it's me your talking to! Thanks : ) "
elif message.content in command2:
response = "test"
if message.content in top:
await message.channel.send(response)
I was expecting the bot to take the message after it's reply into account but, the bot just starts from the beginning again.