use theme colors for embeds

This commit is contained in:
Jan 2022-07-16 14:41:56 +02:00
parent f985c6f499
commit 2f7cfae050
Signed by: Lea
GPG key ID: 5D5E18ACB990F57A
4 changed files with 7 additions and 7 deletions

View file

@ -90,7 +90,7 @@ export default {
try {
let user = await parseUserOrId(userStr);
if (!user) {
embeds.push(embed(`I can't resolve \`${sanitizeMessageContent(userStr).trim()}\` to a user.`, null, '#ff785d'));
embeds.push(embed(`I can't resolve \`${sanitizeMessageContent(userStr).trim()}\` to a user.`, null, EmbedColor.SoftError));
continue;
}

View file

@ -59,7 +59,7 @@ export default {
try {
let user = await parseUserOrId(userStr);
if (!user) {
embeds.push(embed(`I can't resolve \`${sanitizeMessageContent(userStr).trim()}\` to a user.`, null, '#ff785d'));
embeds.push(embed(`I can't resolve \`${sanitizeMessageContent(userStr).trim()}\` to a user.`, null, EmbedColor.SoftError));
continue;
}

View file

@ -58,7 +58,7 @@ export default {
reason = reason ? `${userInput} ${reason}` : userInput;
}
else {
embeds.push(embed(`I can't resolve \`${sanitizeMessageContent(userStr).trim()}\` to a user.`, null, '#ff785d'));
embeds.push(embed(`I can't resolve \`${sanitizeMessageContent(userStr).trim()}\` to a user.`, null, EmbedColor.SoftError));
}
continue;
}

View file

@ -313,10 +313,10 @@ function sanitizeMessageContent(msg: string): string {
}
enum EmbedColor {
Error = "#ff450c",
SoftError = "#ff785d",
Warning = "#ffda55",
Success = "#23ff91",
Error = "var(--error)",
SoftError = "var(--warning)",
Warning = "var(--warning)",
Success = "var(--success)",
}
function embed(content: string, title?: string|null, color?: string|EmbedColor): SendableEmbed {