title: discord py how can i give a role to server member user with id
body: <p><strong>Explanation about what my code does:</strong> my code checks if a member on my server has the specific keyword &quot;TEST&quot; in her activity and gives a rank for it to the user. And if the keyword gets removed from the activity, the rank gets removed too. Offline members are not affected by this. So I had to save the member is in a file.</p>
  <p>Now i have a problem:</p>
  <pre><code>await bot.guilds[0].get_member(int(member_id)).add_roles(role)
  AttributeError: 'int' object has no attribute 'id'
  </code></pre>
  <p>And thats my code:</p>
  <pre><code>@tasks.loop(seconds=120)
  async def check_activity():
      role = 773634102149775390
      file = open('role_members.txt', 'r')
      member_list = [str(member.id) for member in bot.get_all_members() if not str(member.status) == 'offline' and 'TEST' in str(member.activity)]
      for line in file.readlines():
          if line[:-1] not in member_list:
              member = await bot.guilds[0].get_member(int(line))
              await member.remove_roles(role)
      a_file = open('role_members.txt', 'a')
      for member_id in member_list:
          await bot.guilds[0].get_member(int(member_id)).add_roles(role)
          a_file.write(member_id + '\n')
              
          
  check_activity.start()
  </code></pre>
  <p><strong>How can I fix this?</strong></p>