From e33ccc48b3560603925626efe8eb68b79ec3c0ec Mon Sep 17 00:00:00 2001 From: Akulij Date: Fri, 2 May 2025 17:21:46 +0300 Subject: [PATCH] add support for telegrams ?start=... hidden tag pushing them into user.metas --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8f78d6f..aa9c713 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,7 +48,7 @@ pub struct Config { #[command(rename_rule = "lowercase")] enum UserCommands { /// The first message of user - Start, + Start(String), /// Shows this message. Help, } @@ -692,7 +692,10 @@ async fn user_command_handler( msg.html_text().unwrap_or("|EMPTY_MESSAGE|".into()) ); match cmd { - UserCommands::Start => { + UserCommands::Start(meta) => { + if !meta.is_empty() { + user.insert_meta(&mut db, &meta).await?; + } let mut db2 = db.clone(); answer_message( &bot,