check colors on discord embeds
This commit is contained in:
parent
00feba1ddb
commit
fcfe5ea667
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue