📌  相关文章
📜  discord.js dm 所有成员 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:37.594000             🧑  作者: Mango

代码示例1
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}`));
});