Skip to Content
BuildcordDocs

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

SettingWhat it does
With rolesOnly members with any of these roles. Empty is everyone.
Only these membersIds or mentions, separated by commas, such as {user.id}. Read just these instead of the whole server.
Can they seeChannels, separated by commas. Each member's canView says which of them they can see.
Include botsOff by default.
At mostUp to 10000. 1000 when empty.

Ways out

Way outWhen
foundAt least one member matched.
noneNone did.

Tokens

TokenValue
{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?