N
N
Nikita Kudrin2020-10-28 17:50:03
Node.js
Nikita Kudrin, 2020-10-28 17:50:03

How to send a message to everyone on the server at once?

How to send a message to all members of the Discord server at once?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew Ghostuhin, 2020-11-02
@HepkaPlay

client.on('message', msg => {
  if (msg.guild && msg.content.startsWith('/private')) {
    let text = msg.content.slice('/private'.length); // cuts off the /private part
    msg.guild.members.forEach(member => {
      if (member.id != client.user.id && !member.user.bot) member.send(text);
    });
  }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question