Reputation: 19
So I'm making kind of like a combat simulator discord python bot and for the command in which the user actually fights, I need to check for messages after the fight command is used.
@client.command
async def on_message(message):
if message.content == ('.fight'):
await message.channel.send('Do you want to defend or attack?')
#check for message here
After the bot checks for the message, I want the bot to do something if the message sent equals 'defend' and do something else if the message sent equals 'attack'.
Any help would be greatly appreciated. Thank you!
Upvotes: 0
Views: 3902
Reputation: 101
Try -
def check(m):
return ctx.author == m.author #To make sure it is the only message author is getting
msg = await self.bot.wait_for('message', timeout=60.0, check=check)
Then -
if msg.content.lower() == 'defend':
#Your code
Upvotes: 3