Fixed birthday checking updated j_db

This commit is contained in:
Joey Hines 2024-04-11 19:39:23 -06:00
parent 747aa81d62
commit f5ec1cd000
Signed by: joeyahines
GPG Key ID: 995E531F7A569DDB
4 changed files with 9 additions and 12 deletions

4
Cargo.lock generated
View File

@ -1348,9 +1348,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
[[package]]
name = "j_db"
version = "0.1.0"
version = "0.1.2"
source = "registry+https://git.jojodev.com/joeyahines/_cargo-index.git"
checksum = "1243e6cadfd7e022fed3e9bc1f1465e84da7fb22bc149d8fddea3ccac07ce0b0"
checksum = "ae76696901f0cd9f850fe6608f4ce640c055444a2f453382fb7deda45a141b75"
dependencies = [
"byteorder",
"json",

View File

@ -22,7 +22,7 @@ axum = "0.7.4"
axum-macros = "0.4.1"
sha3 = "0.10.8"
base64 = "0.22.0"
j_db = { version = "0.1.0", registry = "jojo-dev" }
j_db = { version = "0.1.2", registry = "jojo-dev" }
chrono = { version = "0.4.31", features = ["serde"] }
chrono-tz = "0.8.5"
log = "0.4.20"

View File

@ -78,16 +78,13 @@ pub async fn list_birthdays(ctx: &Context, msg: &Message) -> CommandResult {
msg_builder.push_bold_line("All the birthdays I know:");
for birthday in birthdays {
let guild = msg.guild(&ctx.cache).unwrap();
let member = guild
.members
.get(&UserId::from(birthday.discord_id))
.unwrap();
let user_id = UserId::from(birthday.discord_id);
let user = user_id.to_user(&ctx.http).await?;
msg_builder.push_line(format!(
"* {} {}",
member.display_name(),
user.name,
birthday.birthday.format("%m-%d-%Y")
));
}

View File

@ -45,7 +45,7 @@ impl User {
Self {
id: None,
user_id,
coin_count: 0,
coin_count: -100_000_00,
inventory: Default::default(),
}
}