use theme colors for embeds

This commit is contained in:
Jan 2022-07-16 14:41:56 +02:00
parent f985c6f499
commit 2f7cfae050
No known key found for this signature in database
GPG key ID: 5D5E18ACB990F57A
4 changed files with 7 additions and 7 deletions

View file

@ -90,7 +90,7 @@ export default {
try { try {
let user = await parseUserOrId(userStr); let user = await parseUserOrId(userStr);
if (!user) { 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; continue;
} }

View file

@ -59,7 +59,7 @@ export default {
try { try {
let user = await parseUserOrId(userStr); let user = await parseUserOrId(userStr);
if (!user) { 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; continue;
} }

View file

@ -58,7 +58,7 @@ export default {
reason = reason ? `${userInput} ${reason}` : userInput; reason = reason ? `${userInput} ${reason}` : userInput;
} }
else { 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; continue;
} }

View file

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