Reuse the embed color in multiple files.

This commit is contained in:
toast 2023-12-07 11:22:16 +11:00
parent 6955049dc0
commit 0b70affb92
2 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,7 @@ pub async fn data(
ctx.send(|m| { ctx.send(|m| {
m.embed(|e| { m.embed(|e| {
e.color(0xf1d63c) e.color(crate::COLOR)
.author(|a| { .author(|a| {
a.name(format!("{}/{}", slot_cur, slot_cap)) a.name(format!("{}/{}", slot_cur, slot_cap))
}) })

View File

@ -4,6 +4,8 @@ use poise::serenity_prelude::{self as serenity};
type Error = Box<dyn std::error::Error + Send + Sync>; type Error = Box<dyn std::error::Error + Send + Sync>;
pub static COLOR: i32 = 0xf1d63c;
async fn on_ready( async fn on_ready(
ctx: &serenity::Context, ctx: &serenity::Context,
ready: &serenity::Ready, ready: &serenity::Ready,
@ -13,7 +15,7 @@ async fn on_ready(
serenity::ChannelId(865673694184996888).send_message(&ctx.http, |m| { serenity::ChannelId(865673694184996888).send_message(&ctx.http, |m| {
m.embed(|e| { m.embed(|e| {
e.color(0xf1d63c) e.color(COLOR)
.thumbnail(ready.user.avatar_url().unwrap_or_default()) .thumbnail(ready.user.avatar_url().unwrap_or_default())
.author(|a| { .author(|a| {
a.name(format!("{} is ready!", ready.user.name)) a.name(format!("{} is ready!", ready.user.name))