add support for telegrams ?start=... hidden tag pushing them into user.metas
This commit is contained in:
parent
56f1ee41fc
commit
e33ccc48b3
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user