add from in the replay spoiler message

This commit is contained in:
2023-11-12 20:26:12 +01:00
parent 61d7a09e01
commit a46a703f7c
4 changed files with 21 additions and 13 deletions

View File

@@ -2,6 +2,7 @@ use teloxide::prelude::*;
use chrono::Local;
use std::cmp::Ordering::Equal;
use std::str;
use crate::telegram_utils::*;
mod database;
fn change_day(last_day: &str) -> bool{
@@ -32,13 +33,6 @@ fn do_fail(group_id: &str, user_id: &str, user_name: &str){
data.write_points(group_id, user_id, user_name, &Local::now().format("%Y-%m-%d").to_string(),Rewards::FAIL as i64);
}
fn get_alias(msg: &teloxide::prelude::Message) -> String {
match &msg.from().unwrap().username {
Some(alias) => format!("@{}",alias),
None => format!("{}",&*msg.from().unwrap().first_name),
}
}
fn check_user_points(msg: &teloxide::prelude::Message, rw: Rewards) -> bool{
let data: database::DatabasePole = database::DatabasePole::get_database();
let ret = data.check_user_pole(&msg.chat.id.to_string(),