@@ -209,36 +209,40 @@ impl Article {
209
209
210
210
impl From < Article > for InlineResult {
211
211
fn from ( article : Article ) -> Self {
212
- Self ( tl:: enums:: InputBotInlineResult :: Result (
213
- tl:: types:: InputBotInlineResult {
214
- id : article
215
- . id
216
- . unwrap_or_else ( || generate_random_id ( ) . to_string ( ) ) ,
217
- r#type : "article" . into ( ) ,
218
- title : Some ( article. title ) ,
219
- description : article. description ,
220
- url : article. url ,
221
- thumb : article. thumb_url . map ( |url| {
222
- tl:: enums:: InputWebDocument :: Document ( tl:: types:: InputWebDocument {
223
- url,
224
- size : 0 ,
225
- mime_type : "image/jpeg" . into ( ) ,
226
- attributes : vec ! [ ] ,
227
- } )
228
- } ) ,
229
- content : None ,
230
- // TODO: also allow other types of messages than text
231
- send_message : tl:: enums:: InputBotInlineMessage :: Text (
232
- tl:: types:: InputBotInlineMessageText {
233
- no_webpage : !article. input_message . link_preview ,
234
- invert_media : article. input_message . invert_media ,
235
- message : article. input_message . text ,
236
- entities : Some ( article. input_message . entities ) ,
237
- reply_markup : article. input_message . reply_markup ,
238
- } ,
239
- ) ,
240
- } ,
241
- ) )
212
+ Self ( article. into ( ) )
213
+ }
214
+ }
215
+
216
+ impl From < Article > for tl:: enums:: InputBotInlineResult {
217
+ fn from ( article : Article ) -> Self {
218
+ tl:: enums:: InputBotInlineResult :: Result ( tl:: types:: InputBotInlineResult {
219
+ id : article
220
+ . id
221
+ . unwrap_or_else ( || generate_random_id ( ) . to_string ( ) ) ,
222
+ r#type : "article" . into ( ) ,
223
+ title : Some ( article. title ) ,
224
+ description : article. description ,
225
+ url : article. url ,
226
+ thumb : article. thumb_url . map ( |url| {
227
+ tl:: enums:: InputWebDocument :: Document ( tl:: types:: InputWebDocument {
228
+ url,
229
+ size : 0 ,
230
+ mime_type : "image/jpeg" . into ( ) ,
231
+ attributes : vec ! [ ] ,
232
+ } )
233
+ } ) ,
234
+ content : None ,
235
+ // TODO: also allow other types of messages than text
236
+ send_message : tl:: enums:: InputBotInlineMessage :: Text (
237
+ tl:: types:: InputBotInlineMessageText {
238
+ no_webpage : !article. input_message . link_preview ,
239
+ invert_media : article. input_message . invert_media ,
240
+ message : article. input_message . text ,
241
+ entities : Some ( article. input_message . entities ) ,
242
+ reply_markup : article. input_message . reply_markup ,
243
+ } ,
244
+ ) ,
245
+ } )
242
246
}
243
247
}
244
248
0 commit comments