Update embed color and add constant for bot ready notification channel

This commit is contained in:
toast 2024-01-08 03:22:08 +11:00
parent b08a5c474a
commit 4b497658db
2 changed files with 5 additions and 4 deletions

View File

@ -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))
)

View File

@ -5,7 +5,8 @@ use std::env::var;
type Error = Box<dyn std::error::Error + Send + Sync>;
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?;