From f985c6f499cd76e1ea610b9b08d548da8cb022ba Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Jul 2022 14:24:28 +0200 Subject: [PATCH] bridge role colors --- bridge/src/discord/events.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge/src/discord/events.ts b/bridge/src/discord/events.ts index 4095256..6422e38 100644 --- a/bridge/src/discord/events.ts +++ b/bridge/src/discord/events.ts @@ -196,6 +196,11 @@ client.on('messageCreate', async message => { masquerade: { name: message.author.username, avatar: message.author.displayAvatarURL({ size: 128 }), + colour: channel.server?.havePermission('ManageRole') + ? message.member?.displayColor // Discord.js returns black or 0 instead of undefined when no role color is set + ? message.member?.displayHexColor + : 'var(--foreground)' + : undefined, }, embeds: message.embeds.length ? message.embeds.map(e => new GenericEmbed(e).toRevolt())