From 4b497658db1e1de6c30c1a0f3e741ff8c1e01cba Mon Sep 17 00:00:00 2001 From: toast Date: Mon, 8 Jan 2024 03:22:08 +1100 Subject: [PATCH] Update embed color and add constant for bot ready notification channel --- src/commands/data.rs | 2 +- src/main.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/commands/data.rs b/src/commands/data.rs index 79f1d73..adfe45e 100644 --- a/src/commands/data.rs +++ b/src/commands/data.rs @@ -37,7 +37,7 @@ pub async fn data( let minute = (daytime / 60 / 1000) % 60; let time = format!("{:02}:{:02}", hour, minute); - ctx.send(|m| m.embed(|e| e.color(crate::COLOR) + ctx.send(|m| m.embed(|e| e.color(crate::EMBED_COLOR) .author(|a| a.name(format!("{}/{}", slot_cur, slot_cap)) ) diff --git a/src/main.rs b/src/main.rs index 50f092b..d4aa754 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,8 @@ use std::env::var; type Error = Box; -pub static COLOR: i32 = 0xf1d63c; +pub static EMBED_COLOR: i32 = 0xf1d63c; +static BOT_READY_NOTIFY: u64 = 865673694184996888; async fn on_ready( ctx: &serenity::Context, @@ -14,8 +15,8 @@ async fn on_ready( ) -> Result<(), Error> { println!("Connected to API as {}", ready.user.name); - serenity::ChannelId(865673694184996888).send_message(&ctx.http, |m| m.embed(|e| - e.color(COLOR) + serenity::ChannelId(BOT_READY_NOTIFY).send_message(&ctx.http, |m| m.embed(|e| + e.color(EMBED_COLOR) .thumbnail(ready.user.avatar_url().unwrap_or_default()) .author(|a| a.name(format!("{} is ready!", ready.user.name))) )).await?;