List members
Read the server's members, with their roles and the channels they can see.
member.list reads the server's members as a list, for counting an electorate, picking who to remind, or anything else that needs everyone at once.
Settings
| Setting | What it does |
|---|---|
| With roles | Only members with any of these roles. Empty is everyone. |
| Only these members | Ids or mentions, separated by commas, such as {user.id}. Read just these instead of the whole server. |
| Can they see | Channels, separated by commas. Each member's canView says which of them they can see. |
| Include bots | Off by default. |
| At most | Up to 10000. 1000 when empty. |
Ways out
| Way out | When |
|---|---|
found | At least one member matched. |
none | None did. |
Tokens
| Token | Value |
|---|---|
{members.list} | The members, as a list. Each has id, name, mention, bot, roles (ids) and, with channels given, canView (channel ids). |
{members.count} | How many there are |
Notes
- Discord only lists a server's members to bots with the Server Members intent. The builder turns it on for a bot that uses this step; it also has to be allowed in the Discord Developer Portal.
- Reading a big server takes a moment: Discord hands members over a thousand at a time.
Example
A poll's quorum: list members with the voting role who can see the poll's channel, then in Run code count ctx.members.list against the votes.
Was this page helpful?