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")]
|
#[command(rename_rule = "lowercase")]
|
||||||
enum UserCommands {
|
enum UserCommands {
|
||||||
/// The first message of user
|
/// The first message of user
|
||||||
Start,
|
Start(String),
|
||||||
/// Shows this message.
|
/// Shows this message.
|
||||||
Help,
|
Help,
|
||||||
}
|
}
|
||||||
@ -692,7 +692,10 @@ async fn user_command_handler(
|
|||||||
msg.html_text().unwrap_or("|EMPTY_MESSAGE|".into())
|
msg.html_text().unwrap_or("|EMPTY_MESSAGE|".into())
|
||||||
);
|
);
|
||||||
match cmd {
|
match cmd {
|
||||||
UserCommands::Start => {
|
UserCommands::Start(meta) => {
|
||||||
|
if !meta.is_empty() {
|
||||||
|
user.insert_meta(&mut db, &meta).await?;
|
||||||
|
}
|
||||||
let mut db2 = db.clone();
|
let mut db2 = db.clone();
|
||||||
answer_message(
|
answer_message(
|
||||||
&bot,
|
&bot,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user