From b2e1147b303295f028d4474852f8bb81a8dbdc02 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Wed, 10 Feb 2021 21:21:54 -0600 Subject: [PATCH] feat: make embed colour represent rarity --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index bb52796..de7a6e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ use serenity::framework::standard::{ CommandResult, StandardFramework, }; use serenity::model::channel::Message; +use serenity::utils::Colour; use std::env; use std::time::{SystemTime, UNIX_EPOCH}; @@ -110,6 +111,12 @@ async fn roll(ctx: &Context, msg: &Message) -> CommandResult { 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 .send_message(ctx, |m| { m.reference_message(msg).embed(|embed| { @@ -123,6 +130,7 @@ async fn roll(ctx: &Context, msg: &Message) -> CommandResult { .icon_url(icon_url) .text("Image Source: https://thearchive.gg") }) + .colour(rarity_colour) }) }) .await?;