I think I like the old ready notification
All checks were successful
Build and push container image / build (push) Successful in 10m50s

This commit is contained in:
toast 2024-03-13 20:09:09 +11:00
parent 97100fb355
commit 8d439d9d54
6 changed files with 11 additions and 10 deletions

2
Cargo.lock generated
View File

@ -833,7 +833,7 @@ dependencies = [
[[package]]
name = "kon"
version = "0.1.19"
version = "0.1.20"
dependencies = [
"cargo_toml",
"gamedig",

View File

@ -1,7 +1,7 @@
[package]
name = "kon"
version = "0.1.19"
rust-version = "1.74"
version = "0.1.20"
rust-version = "1.75"
edition = "2021"
[dependencies]
@ -27,6 +27,6 @@ opt-level = 0
debug = true
[profile.release]
opt-level = 3
opt-level = 2
debug = false
strip = true

View File

@ -1,6 +1,6 @@
use crate::{
Error,
EMBED_COLOR,
utils::EMBED_COLOR,
models::gameservers::Gameservers
};

View File

@ -1,9 +1,9 @@
use crate::{
Error,
EMBED_COLOR,
models::gameservers::Gameservers,
commands::gameserver::ac_server_name,
utils::BOT_VERSION
utils::BOT_VERSION,
utils::EMBED_COLOR
};
use std::{

View File

@ -22,7 +22,6 @@ use serenity::{
type Error = Box<dyn error::Error + Send + Sync>;
pub static EMBED_COLOR: i32 = 0x5a99c7;
static BOT_READY_NOTIFY: u64 = 865673694184996888;
async fn on_ready(
@ -34,9 +33,9 @@ async fn on_ready(
let message = CreateMessage::new();
let ready_embed = CreateEmbed::new()
.color(EMBED_COLOR)
.color(utils::EMBED_COLOR)
.thumbnail(ready.user.avatar_url().unwrap_or_default())
.author(CreateEmbedAuthor::new(format!("{} ({}) is ready!", ready.user.name, &**utils::BOT_VERSION)).clone());
.author(CreateEmbedAuthor::new(format!("{} is ready!", ready.user.name)).clone());
serenity::ChannelId::new(BOT_READY_NOTIFY).send_message(&ctx.http, message.add_embed(ready_embed)).await?;

View File

@ -1,5 +1,7 @@
use once_cell::sync::Lazy;
pub static EMBED_COLOR: i32 = 0x5a99c7;
pub static BOT_VERSION: Lazy<String> = Lazy::new(|| {
let cargo_version = cargo_toml::Manifest::from_path("Cargo.toml").unwrap().package.unwrap().version.unwrap();
format!("v{}", cargo_version)