diff --git a/lib/grammers-client/src/client/bots.rs b/lib/grammers-client/src/client/bots.rs index aedf345d..660f091b 100644 --- a/lib/grammers-client/src/client/bots.rs +++ b/lib/grammers-client/src/client/bots.rs @@ -166,7 +166,13 @@ impl Client { ) -> Result { let message: InputMessage = input_message.into(); let entities = parse_mention_entities(self, message.entities); - let result = if message.media.is_some() { + if message.media.as_ref().is_some_and(|media| { + !matches!( + media, + tl::enums::InputMedia::PhotoExternal(_) + | tl::enums::InputMedia::DocumentExternal(_), + ) + }) { let dc_id = message_id.dc_id(); self.invoke_in_dc( &tl::functions::messages::EditInlineBotMessage { @@ -180,19 +186,18 @@ impl Client { }, dc_id, ) - .await? + .await } else { self.invoke(&tl::functions::messages::EditInlineBotMessage { id: message_id, message: Some(message.text), - media: None, + media: message.media, entities, no_webpage: !message.link_preview, reply_markup: message.reply_markup, invert_media: message.invert_media, }) - .await? - }; - Ok(result) + .await + } } }