title: How to loop through all members and their Roles in discord.py
body: <pre><code>    async def interest(self):
          channel = self.client.get_channel(779743465252192297)
          em = discord.Embed(title =&quot;Interest By time : &quot;,color = discord.Colour.random())
          total = 0 
          for members in discord.Guild.members:
              try:
                  em.add_field(name = &quot;Member Name: &quot;,value = members.name)
                  for keys,values in role.items():
                      if keys in members.roles.name:
                          em.add_field(name=f&quot;{keys} : &quot; ,value = values)
                          total += values
                  em.add_field(name = &quot;Total : &quot; ,value = total )
                  em.set_footer(text = &quot;Type `.role_shop` to See how you can spend Money&quot;,icon_url=channel.guild.owner.avatar_url)
                  
                  await members.send(embed = em)
              except:
                  pass
  </code></pre>
  <p>This is my code and I want to loop through all members and then through their roles and add a value to the var total.
  This is my role Dict :<code>role = {&quot;Coder&quot;:100,&quot;Gamer&quot;:100,&quot;Anime Weeb&quot;:100,&quot;Superior Coder&quot;:150,&quot;Mods&quot;:100,&quot;Partners&quot;:50,&quot;Owner&quot;:999999}</code></p>
  <p>The error which I am receiving is :<code> File &quot;d:\bot1\fold\onevent.py&quot;, line 33, in interest for members in discord.Guild.members: TypeError: 'property' object is not iterable</code></p>
  <p>Plz provide a way through which I can perform my Task</p>