add support for telegrams ?start=... hidden tag pushing them into user.metas

This commit is contained in:
Akulij 2025-05-02 17:21:46 +03:00
parent 56f1ee41fc
commit e33ccc48b3

View File

@ -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,