3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 00:05:04 +00:00

Add embed color, copieable mention, permissions

This commit is contained in:
Jonathan B 2020-10-08 21:04:21 +02:00
parent 8ff2b6614c
commit 3aaf012008

View file

@ -25,6 +25,8 @@ export async function getRoleInfoEmbed(
// name: role.name, // name: role.name,
// icon_url: icon, // icon_url: icon,
// }; // };
embed.color = role.color;
const createdAt = moment.utc(role.createdAt, "x"); const createdAt = moment.utc(role.createdAt, "x");
const timeAndDate = pluginData.getPlugin(TimeAndDatePlugin); const timeAndDate = pluginData.getPlugin(TimeAndDatePlugin);
@ -37,6 +39,12 @@ export async function getRoleInfoEmbed(
round: true round: true
}); });
let rolePermsArray : Array<string> = [];
for (const [x, _x] of Object.entries(role.permissions.json)) {
rolePermsArray.push(x.toString())
}
const rolePerms = rolePermsArray.join(', ')
embed.fields.push({ embed.fields.push({
name: preEmbedPadding + "Role information", name: preEmbedPadding + "Role information",
value: trimLines(` value: trimLines(`
@ -48,9 +56,9 @@ export async function getRoleInfoEmbed(
Mentionable: ${role.mentionable} Mentionable: ${role.mentionable}
Hoisted: ${role.hoist} Hoisted: ${role.hoist}
Managed: ${role.managed} Managed: ${role.managed}
Permissions: TODO Permissions: ${rolePerms}
Members: TODO Members: TODO
Mention: <@&${role.id}> Mention: <@&${role.id}> (\`<@&${role.id}>\`)
`), `),
}); });