3

Just wondering how i would go about getting a list of all current members in a guild and then returning this as a message?

Marcus Beal
  • 31
  • 1
  • 1
  • 2
  • 1
    Possible duplicate of [How do I get a list of all members in a discord server using the new discord.py version?](https://stackoverflow.com/questions/56519760/how-do-i-get-a-list-of-all-members-in-a-discord-server-using-the-new-discord-py) – Patrick Haugh Aug 23 '19 at 23:53

2 Answers2

4

If you want to get the amount of members in specific guild, you can use len(guild.members). If you'd like to get list just use guild.members. If you want to send it, it might not work because Discord has max. 2000 characters in one message, but if your server is small then it should be good.

Dec0Dedd
  • 335
  • 2
  • 12
  • this actually isn't returning a full list. – John Sohn Sep 18 '21 at 18:29
  • 1
    @JohnSohn I've answered this question 2 years ago. A lot has changed since that time, e.g. bot intents. – Dec0Dedd Sep 19 '21 at 20:23
  • https://stackoverflow.com/questions/56519760/how-do-i-get-a-list-of-all-members-in-a-discord-server-using-the-new-discord-py/69237608#69237608 – John Sohn Sep 20 '21 at 22:33
  • I added the updated answer to this. – John Sohn Sep 20 '21 at 22:33
  • see post and review if you would. you are quite right, so therefore the answer needs updated. I often wonder if someone couldn't add commentary indicating the reasoning behind WHY a change was made, wouldn't that be helpful to understand ? – John Sohn Sep 21 '21 at 13:01
0

if you want to get the Member Count Use guild.member_count where guild is the guild object and if you want a list, you can iterate over guild.membersand append them

ShaDii
  • 47
  • 5