|
@ -833,7 +833,7 @@ client.on('roleCreate', role => { |
|
|
const roleCreateEmbed = new Discord.MessageEmbed() |
|
|
const roleCreateEmbed = new Discord.MessageEmbed() |
|
|
.setTitle("Role Added") |
|
|
.setTitle("Role Added") |
|
|
.addField("Name", role.name) |
|
|
.addField("Name", role.name) |
|
|
.addField("Permissions", role.permissions.bitfield) |
|
|
.addField("Permissions", role.permissions.toArray().map(p => `\`${p}\``.toLowerCase()).join(' • ')) |
|
|
.addField("Mentionable", role.mentionable) |
|
|
.addField("Mentionable", role.mentionable) |
|
|
.setFooter("Role ID: " + role.id) |
|
|
.setFooter("Role ID: " + role.id) |
|
|
.setTimestamp() |
|
|
.setTimestamp() |
|
@ -855,7 +855,7 @@ client.on('roleDelete', role => { |
|
|
const roleDeleteEmbed = new Discord.MessageEmbed() |
|
|
const roleDeleteEmbed = new Discord.MessageEmbed() |
|
|
.setTitle("Role Removed") |
|
|
.setTitle("Role Removed") |
|
|
.addField("Name", role.name) |
|
|
.addField("Name", role.name) |
|
|
.addField("Permissions", role.permissions.bitfield) |
|
|
.addField("Permissions", role.permissions.toArray().map(p => `\`${p}\``.toLowerCase()).join(' • ')) |
|
|
.addField("Mentionable", role.mentionable) |
|
|
.addField("Mentionable", role.mentionable) |
|
|
.setFooter("Role ID: " + role.id) |
|
|
.setFooter("Role ID: " + role.id) |
|
|
.setTimestamp() |
|
|
.setTimestamp() |
|
@ -874,6 +874,8 @@ client.on('roleDelete', role => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
client.on('roleUpdate', (oldRole, newRole) => { |
|
|
client.on('roleUpdate', (oldRole, newRole) => { |
|
|
|
|
|
const removedPerms = oldRole.permissions.filter(perm => !newRole.hasPermission(perm)); |
|
|
|
|
|
const addedPerms = newRole.permissions.filter(perm => !oldRole.hasPermission(perm)); |
|
|
const roleUpdateEmbed = new Discord.MessageEmbed() |
|
|
const roleUpdateEmbed = new Discord.MessageEmbed() |
|
|
.setTitle("Role Updated") |
|
|
.setTitle("Role Updated") |
|
|
.addField("Name", `${oldRole.name} >> ${newRole.name}`) |
|
|
.addField("Name", `${oldRole.name} >> ${newRole.name}`) |
|
@ -882,6 +884,12 @@ client.on('roleUpdate', (oldRole, newRole) => { |
|
|
.setFooter("Role ID: " + newRole.id) |
|
|
.setFooter("Role ID: " + newRole.id) |
|
|
.setTimestamp() |
|
|
.setTimestamp() |
|
|
.setColor('c9ff00'); |
|
|
.setColor('c9ff00'); |
|
|
|
|
|
if (removedPerms.array().length > 0) { |
|
|
|
|
|
roleUpdateEmbed.addField("Permissions Removed", removedPerms.map(p => `${p}`).join(' • ')); |
|
|
|
|
|
} |
|
|
|
|
|
if (addedPerms.array().length > 0) { |
|
|
|
|
|
roleUpdateEmbed.addField("Permissions Added", addedPerms.map(p => `${p}`).join(' • ')); |
|
|
|
|
|
} |
|
|
collection.findOne({ guild_id: newRole.guild.id }, (error, result) => { |
|
|
collection.findOne({ guild_id: newRole.guild.id }, (error, result) => { |
|
|
if (error) { |
|
|
if (error) { |
|
|
console.error; |
|
|
console.error; |
|
@ -954,7 +962,7 @@ client.on('guildMemberUpdate', (oldMember, newMember) => { |
|
|
.setFooter("Member ID: " + newMember.id) |
|
|
.setFooter("Member ID: " + newMember.id) |
|
|
.setThumbnail(newMember.user.avatarURL()) |
|
|
.setThumbnail(newMember.user.avatarURL()) |
|
|
.setTimestamp() |
|
|
.setTimestamp() |
|
|
.setColor('e7778b'); |
|
|
.setColor('c9ff00'); |
|
|
if (removedRoles) { |
|
|
if (removedRoles) { |
|
|
memberUpdateEmbed.addField("Roles Removed", removedRoles.map(r => `${r}`).join(' • ')); |
|
|
memberUpdateEmbed.addField("Roles Removed", removedRoles.map(r => `${r}`).join(' • ')); |
|
|
} |
|
|
} |
|
|