start cmd now works in chats as well
This commit is contained in:
parent
0825e5d96a
commit
0a2bde0741
1 changed files with 10 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
use teloxide::prelude::*;
|
use teloxide::prelude::*;
|
||||||
use teloxide::types::{Me, MessageNewChatMembers};
|
use teloxide::types::Me;
|
||||||
use tracing::{event, Level};
|
use tracing::{event, Level};
|
||||||
|
|
||||||
use super::types::HandlerResult;
|
use super::types::HandlerResult;
|
||||||
|
|
@ -25,6 +25,15 @@ pub async fn cmd_start(bot: Bot, msg: Message, db: DbPool) -> HandlerResult {
|
||||||
bot.send_message(msg.chat.id, t!("started_private_chat"))
|
bot.send_message(msg.chat.id, t!("started_private_chat"))
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
} else if msg.chat.is_channel()
|
||||||
|
|| msg.chat.is_chat()
|
||||||
|
|| msg.chat.is_group()
|
||||||
|
|| msg.chat.is_supergroup()
|
||||||
|
{
|
||||||
|
let chat = find_or_create_chat(&db, &msg.chat).await?;
|
||||||
|
event!(Level::INFO, "started public chat {}", chat);
|
||||||
|
bot.send_message(msg.chat.id, t!("started_public_chat"))
|
||||||
|
.await?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue