Answers for "discord.js dm all members"

0

discord.js dm all members

message.guild.members.cache.forEach(member => { // Looping through each member of the guild.
    // Trying to send a message to the member.
    // This method might fail because of the member's privacy settings, so we're using .catch
    member.send("Hello, this is my message!").catch(e => console.error(`Couldn't DM member ${member.user.tag}`));
});
Posted by: Guest on July-07-2021

Code answers related to "discord.js dm all members"

Code answers related to "Javascript"

Browse Popular Code Answers by Language