title: How to receive a message from a certain user in discord, then wait for another certain user's reply, then send a custom message in python
body: <p>I'm new to python and discord bots. I created a bot for my friend's server and I'm stuck on a certain event.
  I want to be able to:</p>
  <ol>
  <li>Wait for a certain user to send a random message</li>
  <li>Wait for a certain user to respond to that message (if the someone else replies before the user I want, I want the code to stop running</li>
  <li>Have the bot send a message</li>
  </ol>
  <p>Here's my code, it may be incorrect, but I have never done something like this before. I would love it if someone replied with the full event function. Thanks!</p>
  <pre><code>@client.event
  async def on_message(message):
      if (message.author.id == &quot;User who sends the first message&quot;):   
              async def on_message(message):    
                  if (message.author.id == &quot;User who replies&quot;):
                      await message.channel.send(&quot;Test worked&quot;)
                      print(on_message)
                  else:
                      return
      else:
          return
  </code></pre>