Private Message all members in server (D.JS 14)

i'm trying to make an annoucement system, and make it private message all members of the server when annoucement command activated codeblock:
const ANNC_TYPE_NOTIFY = "Notify"
const ANNC_TYPE_EVENT = "Event"
const ANNC_TYPE_EMERGENCY = "Emergency announcement"

client_emilie.guild.members.fetch().then(async (members) => {
members.forEach(async (member) => {
member.send('hello world | ' + ANNC_TYPE_NOTIFY)
});
});
const ANNC_TYPE_NOTIFY = "Notify"
const ANNC_TYPE_EVENT = "Event"
const ANNC_TYPE_EMERGENCY = "Emergency announcement"

client_emilie.guild.members.fetch().then(async (members) => {
members.forEach(async (member) => {
member.send('hello world | ' + ANNC_TYPE_NOTIFY)
});
});
OS: Arch Linux x86_64 discord.js library version: latest stable from npm
3 Replies
d.js toolkit
d.js toolkit4d ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
d.js docs
d.js docs4d ago
Mass DMing users is not allowed as per developer ToS, considered spam and can get you and your bot banned. - Mention @everyone to inform all your users at once instead - Discord Developer Terms of Service: learn more | FAQ summary
sewerend
sewerendOP4d ago
oh, alright so the issue is solved thanks!
Want results from more Discord servers?
Add your server