From 0b70affb92169e267d274e32cda29555724d4686 Mon Sep 17 00:00:00 2001 From: toast Date: Thu, 7 Dec 2023 11:22:16 +1100 Subject: [PATCH] Reuse the embed color in multiple files. --- src/commands/data.rs | 2 +- src/main.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/data.rs b/src/commands/data.rs index ee0c1a6..8803063 100644 --- a/src/commands/data.rs +++ b/src/commands/data.rs @@ -30,7 +30,7 @@ pub async fn data( ctx.send(|m| { m.embed(|e| { - e.color(0xf1d63c) + e.color(crate::COLOR) .author(|a| { a.name(format!("{}/{}", slot_cur, slot_cap)) }) diff --git a/src/main.rs b/src/main.rs index f2e1945..eee9081 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,8 @@ use poise::serenity_prelude::{self as serenity}; type Error = Box; +pub static COLOR: i32 = 0xf1d63c; + async fn on_ready( ctx: &serenity::Context, ready: &serenity::Ready, @@ -13,7 +15,7 @@ async fn on_ready( serenity::ChannelId(865673694184996888).send_message(&ctx.http, |m| { m.embed(|e| { - e.color(0xf1d63c) + e.color(COLOR) .thumbnail(ready.user.avatar_url().unwrap_or_default()) .author(|a| { a.name(format!("{} is ready!", ready.user.name))