A
A
ASMI2282020-11-02 21:53:12
Node.js
ASMI228, 2020-11-02 21:53:12

How to create an array of all server members in discord.js?

I want to make a command for the bot with which I can mention a random member of the server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-11-02
@ASMI228

const ids = client.guilds.cache.get("id_сервера").members.cache.map(member => member.id);
console.log(ids); // ["123456789", "987654321", "152635244"] . . .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question