consts: store colors as hex codes in struct

This commit is contained in:
seth 2024-03-30 04:11:04 -04:00
parent 1ff95de3bf
commit a3014f2694
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
6 changed files with 52 additions and 28 deletions

View file

@ -1,5 +1,5 @@
use crate::consts;
use crate::Data;
use crate::{consts::Colors, Data};
use std::fmt::Write;
use eyre::Report;
@ -34,7 +34,7 @@ pub async fn handle(error: FrameworkError<'_, Data, Report>) {
.title("Something went wrong!")
.description("oopsie")
.timestamp(Timestamp::now())
.color(consts::colors()["red"]);
.color(Colors::RED);
let reply = CreateReply::default().embed(embed);

View file

@ -1,4 +1,4 @@
use crate::{consts, Data};
use crate::{consts::Colors, Data};
use eyre::Result;
use log::{debug, trace};
@ -48,10 +48,10 @@ pub async fn handle(ctx: &Context, message: &Message, data: &Data) -> Result<()>
if issues.is_empty() {
e = e
.color(consts::colors()["green"])
.color(Colors::GREEN)
.description("No issues found automatically");
} else {
e = e.color(consts::colors()["red"]);
e = e.color(Colors::RED);
for (title, description) in issues {
e = e.field(title, description, false);