timezone_of method for more lazy-storage. fix for del command raising issues if 0 is written. fix for get_language not recognising

This commit is contained in:
2020-11-22 12:09:57 +00:00
parent d8bf0240e4
commit 012d90e832
5 changed files with 94 additions and 60 deletions

View File

@ -169,11 +169,13 @@ async fn clock(ctx: &Context, msg: &Message, args: String) {
.expect("Could not get SQLPool from data");
let lm = data.get::<LanguageManager>().unwrap();
let user_data = UserData::from_user(&msg.author, &ctx, &pool).await.unwrap();
let now = Utc::now().with_timezone(&user_data.timezone());
let language = UserData::language_of(&msg.author, &pool).await;
let timezone = UserData::timezone_of(&msg.author, &pool).await;
let clock_display = lm.get(&user_data.language, "clock/time");
let now = Utc::now().with_timezone(&timezone);
let clock_display = lm.get(&language, "clock/time");
if args == "12" {
let _ = msg