feat: make embed colour represent rarity

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-02-10 21:21:54 -06:00
parent 66d965a439
commit b2e1147b30
1 changed files with 8 additions and 0 deletions

View File

@ -12,6 +12,7 @@ use serenity::framework::standard::{
CommandResult, StandardFramework, CommandResult, StandardFramework,
}; };
use serenity::model::channel::Message; use serenity::model::channel::Message;
use serenity::utils::Colour;
use std::env; use std::env;
use std::time::{SystemTime, UNIX_EPOCH}; use std::time::{SystemTime, UNIX_EPOCH};
@ -110,6 +111,12 @@ async fn roll(ctx: &Context, msg: &Message) -> CommandResult {
Rarity::Three => ":star::star::star:", Rarity::Three => ":star::star::star:",
}; };
let rarity_colour = match student.rarity {
Rarity::One => Colour::from_rgb(227, 234, 240),
Rarity::Two => Colour::from_rgb(255, 248, 124),
Rarity::Three => Colour::from_rgb(253, 198, 229),
};
channel channel
.send_message(ctx, |m| { .send_message(ctx, |m| {
m.reference_message(msg).embed(|embed| { m.reference_message(msg).embed(|embed| {
@ -123,6 +130,7 @@ async fn roll(ctx: &Context, msg: &Message) -> CommandResult {
.icon_url(icon_url) .icon_url(icon_url)
.text("Image Source: https://thearchive.gg") .text("Image Source: https://thearchive.gg")
}) })
.colour(rarity_colour)
}) })
}) })
.await?; .await?;