Hello i want to send DM to user with specific role,
(您好,我想将DM发送给具有特定角色的用户,)
i tried this code did not worked.
(我试过这段代码没有用。)
:(:)
const args = message.content.split(" ");
const roleArgs = args.slice(0, 1);
const messageArgs = args.slice(1)
const role = message.guild.roles.find(role => role.name.toLowerCase() === roleArgs.join(" ").toLowerCase())
if (!role) return message.reply('There is not such a role!');
for (let i = 0; i < message.guild.members.size; i++) {
if (message.guild.members[i].roles.has(role.id)) {
message.guild.members[i].user.send(messageArgs.join(" "))
}
}
!dm @role (message)
(!dm @role(消息))
ask by unhitchedsum translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…