Answer the question
In order to leave comments, you need to log in
How to send messages from the bot as a team to all participants who are on the server?
I just started learning JS language, and I want to know how to send a command message to all participants in private messages as embed? And is it even possible?
For example: "!message-all Hello! The bot has a global update!" etc.. and this was sent to all the participants in the discord server on which I wrote this message .
Please help, I've searched the entire internet.
Answer the question
In order to leave comments, you need to log in
message.guild.members.fetch().then(members => {
members.filter(m => !m.user.bot).forEach(member => {
member.send({
embeds: [ваш_embed]
}).catch(() => {
console.log(`${member.user.tag} сообщение не было доставлено`)
})
})
})
const client = new Client({ intents: [...другие интенты, Intents.FLAGS.GUILD_MEMBERS] });
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question