title: Is there a way to convert a string to a discord.Member type in discord.py?
body: <p>I've been trying to add a tic-tac-toe minigame to my discord bot. I originally wrote the code inside a @client.command() because I thought you could use client.wait_for() inside it but unfortunately, you can't. Anyway, I had to convert my code to work on the on_message() function and now I am stumbling the problem of taking a discord.Member variable type from the initial command so like ~tictactoe @user#1234.
  So for example, I tried writing this in the on_message() function to no success.</p>
  <pre><code>if message.content.startswith(&quot;~tictactoe&quot;) or message.content.startwith(&quot;~ttt&quot;):
      member = str(message).split(&quot; &quot;)
      member = discord.Member(member[1])
      channel = message.channel
  </code></pre>
  <p>Here is my full code:</p>
  <pre><code>if message.content.startswith(&quot;~tictactoe&quot;) or message.content.startwith(&quot;~ttt&quot;):
      member = str(message).split(&quot; &quot;)
      member = discord.Member(member[1])
      channel = message.channel
      if member.bot: channel.send(&quot;You can't play against a bot!&quot;)
      else:
          while True:
              x = 0
              player = [message.author if (x % 2 == 0) else member]
              x += 1
              symbol = [':x:' if player == message.author else ':o:']
              def check(m):
                  possibilities = ['a1','a2','a3','b1','b2','b3','c1','c2','c3']
                  return (m.content.lower() in possibilities or m.content.lower() == 'end') and m.author == player and m.channel == channel
              if x != 1:
                  channel.send(&quot;TicTacToe\n{message.author.name} vs. {member.name}&quot;)
                  for i in range(3):
                      channel.send(f&quot;{board[i][0]}{board[i][1]}{board[i][2]}\n&quot;)
              channel.send(f&quot;{player.mention}, where do you want to place your marker?\na1\ta2\ta3\nb1\tb2\tb3\nc1\tc2\tc3\n or `end` to end game&quot;)
              try:
                  cell = await client.wait_for('message', timeout=20.0, check=check)
              except:
                  channel.send(&quot;Input invalid or you took too long to respond.&quot;)
              else:
                  cell = cell.lower()
                  if cell == 'end':
                      break
                  possibilities = [['a1','a2','a3'], ['b1','b2','b3'], ['c1','c2','c3']]
                  board = [[':black_large_square:',':black_large_square:',':black_large_square:'], [':black_large_square:',':black_large_square:',':black_large_square:'], [':black_large_square:',':black_large_square:',':black_large_square:']]
                  for i in range(3):
                      for j in range(3):
                          if cell == str(possibilities[i][j]): board[i][j] == symbol
                  won = False
                  for i in range(3):
                      if board[i][0] == board[i][1] == board[i][2] and won == False:
                          channel.send(f&quot;{player} won the game!&quot;)
                          won == True
                      if board[0][i] == board[1][i] == board[2][i] and won == False:
                          channel.send(f&quot;{player} won the game!&quot;)
                          won = True
                  if board[0][0] == board[1][1] == board[2][2] and won == False:
                      channel.send(f&quot;{player} won the game!&quot;)
                      won = True
                  if board[0][2] == board[1][1] == board[2][0] and won == False:
                      channel.send(f&quot;{player} won the game!&quot;)
                      won = True
  </code></pre>
  <p>Any help apperciated :)</p>