Skip to content

Commit

Permalink
fix: ignore non-private chat
Browse files Browse the repository at this point in the history
  • Loading branch information
AH-dark committed Apr 19, 2024
1 parent 5bc6d44 commit c1a38ef
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ impl IForwardingMessageService for ForwardingMessageService {

let client = self.new_bot_client(&bot.bot_token)?;

match if chat.id.0 == bot.target_chat_id {
let r = if chat.id.0 == bot.target_chat_id {
self.handle_target_chat_message(bot, update.clone()).await
} else {
} else if chat.is_private() {
self.handle_forward_message(bot, update.clone()).await
} {
} else {
log::debug!("Ignoring message from chat {}", chat.id.0);
return Ok(());
};
match r {
Err(err) => {
client
.send_message(chat.id, format!("Error handling message: {}", err))
Expand Down

0 comments on commit c1a38ef

Please sign in to comment.