I want to get all the members of my server, but when I Googled it, I just found that this code snippet would do this:
for guild in client.guilds:
for member in guild.members:
print(member)
Well, this code should display all members, the problem is that it only displays my bot user. But when I put it this way:
@tasks.loop(seconds=10)
async def counter():
for guild in client.guilds:
for member in guild.members:
print(guild.members)
it displays information inside this object [ ] and I won't show it exactly because inside this object it has information about my account and discord server, so how can I change this code so that it shows me the number of members or the names of the members?