title: Get All Members from a Guild in Discord.py
body: <p>Hey this is my following code and it works, but I only get the users with whom I chatted(in private chat) once.</p>
  <pre><code>
  @client.command()
  async def hi(ctx):
      with open('users.txt','w') as f:
          for member in ctx.guild.members:
              print(&quot;{},{}&quot;.format(member,member.id), file=f,)
          print(&quot;done&quot;)
  
  </code></pre>