Skip to content

Commit

Permalink
fix(handler/message): expedient of #33
Browse files Browse the repository at this point in the history
  • Loading branch information
krishukr committed Sep 29, 2024
1 parent a47c7a2 commit 1b0b9fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/handlers/message_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use teloxide::{prelude::*, types::Me, utils::command::BotCommands};
pub async fn message_handler(bot: Bot, msg: Message, me: Me) -> ResponseResult<()> {
log::debug!("{}", serde_json::to_string_pretty(&msg).unwrap());

if !msg.chat.is_supergroup() || msg.via_bot.as_ref().map_or(false, |b| b.id == me.id) {
if msg.thread_id.is_some()
|| !msg.chat.is_supergroup()
|| msg.via_bot.as_ref().map_or(false, |b| b.id == me.id)
{
Ok(())
} else if let Some(text) = msg.text() {
match command_handler::Command::parse(text, me.username()) {
Expand Down

0 comments on commit 1b0b9fe

Please sign in to comment.