diff --git a/bot/src/bot/util.ts b/bot/src/bot/util.ts index f8ec22d..79488cf 100644 --- a/bot/src/bot/util.ts +++ b/bot/src/bot/util.ts @@ -191,7 +191,7 @@ async function sendLogMessage(config: LogConfig, content: LogMessage) { const embed = new MessageEmbed(); if (c.title) embed.setTitle(content.title); if (c.description) embed.setDescription(c.description); - if (c.color) embed.setColor(c.color as ColorResolvable); + if (c.color?.match(/^#[0-9a-fA-F]+$/)) embed.setColor(c.color as ColorResolvable); if (c.fields?.length) { for (const field of c.fields) { embed.addField(field.title, field.content.trim() || "\u200b", field.inline); diff --git a/bridge/src/types/GenericEmbed.ts b/bridge/src/types/GenericEmbed.ts index 2113b39..81cb719 100644 --- a/bridge/src/types/GenericEmbed.ts +++ b/bridge/src/types/GenericEmbed.ts @@ -19,7 +19,7 @@ export default class GenericEmbed { if (embed.title) this.title = embed.title; if (embed.description) this.description = embed.description; if (embed.icon_url?.match(/^http(s)?\:\/\//)) this.icon = embed.icon_url; - if (embed.colour) this.color = (embed.colour as any); + if (embed.colour?.match(/^#[0-9a-fA-F]+$/)) this.color = (embed.colour as any); if (embed.url) this.url = embed.url; } }