exports.run = async (client, oldMember, newMember) => {
const messagechannel = msg.guild.channels.find('name', 'YOUR NAME OF YOUR CHANNEL');
if (oldMember.roles.size < newMember.roles.size) {
const embed = new Discord.RichEmbed()
.setColor('#FE2E2E')
.setTimestamp()
.setAuthor('Role added!')
.addField(`Member:`, `${oldMember.user.tag} (${oldMember.id})`);
for (const role of newMember.roles.map(x => x.id)) {
if (!oldMember.roles.has(role)) {
embed.addField(`Role:`, `${oldMember.guild.roles.get(role).name}`);
}
}
messagechannel.send({
embed
});
}
}
刚想在频道中(或私下)提及某人时,他是我的代码,但这似乎是错误的。有人可以帮我吗?