@@ -501,7 +501,75 @@ func ExampleAnswerInlineQuery() {
501501 continue
502502 }
503503
504- article := tgbotapi .NewInlineQueryResultArticle (update .InlineQuery .ID , "Echo" , update .InlineQuery .Query , "Markdown" )
504+ article := tgbotapi .NewInlineQueryResultArticle (update .InlineQuery .ID , "Echo" , update .InlineQuery .Query )
505+ article .Description = update .InlineQuery .Query
506+
507+ inlineConf := tgbotapi.InlineConfig {
508+ InlineQueryID : update .InlineQuery .ID ,
509+ IsPersonal : true ,
510+ CacheTime : 0 ,
511+ Results : []interface {}{article },
512+ }
513+
514+ if _ , err := bot .AnswerInlineQuery (inlineConf ); err != nil {
515+ log .Println (err )
516+ }
517+ }
518+ }
519+
520+ func ExampleAnswerInlineQueryMarkdown () {
521+ bot , err := tgbotapi .NewBotAPI ("MyAwesomeBotToken" ) // create new bot
522+ if err != nil {
523+ log .Panic (err )
524+ }
525+
526+ log .Printf ("Authorized on account %s" , bot .Self .UserName )
527+
528+ u := tgbotapi .NewUpdate (0 )
529+ u .Timeout = 60
530+
531+ updates , err := bot .GetUpdatesChan (u )
532+
533+ for update := range updates {
534+ if update .InlineQuery == nil { // if no inline query, ignore it
535+ continue
536+ }
537+
538+ article := tgbotapi .NewInlineQueryResultArticleMarkdown (update .InlineQuery .ID , "Echo" , update .InlineQuery .Query )
539+ article .Description = update .InlineQuery .Query
540+
541+ inlineConf := tgbotapi.InlineConfig {
542+ InlineQueryID : update .InlineQuery .ID ,
543+ IsPersonal : true ,
544+ CacheTime : 0 ,
545+ Results : []interface {}{article },
546+ }
547+
548+ if _ , err := bot .AnswerInlineQuery (inlineConf ); err != nil {
549+ log .Println (err )
550+ }
551+ }
552+ }
553+
554+ func ExampleAnswerInlineQueryHTML () {
555+ bot , err := tgbotapi .NewBotAPI ("MyAwesomeBotToken" ) // create new bot
556+ if err != nil {
557+ log .Panic (err )
558+ }
559+
560+ log .Printf ("Authorized on account %s" , bot .Self .UserName )
561+
562+ u := tgbotapi .NewUpdate (0 )
563+ u .Timeout = 60
564+
565+ updates , err := bot .GetUpdatesChan (u )
566+
567+ for update := range updates {
568+ if update .InlineQuery == nil { // if no inline query, ignore it
569+ continue
570+ }
571+
572+ article := tgbotapi .NewInlineQueryResultArticleHTML (update .InlineQuery .ID , "Echo" , update .InlineQuery .Query )
505573 article .Description = update .InlineQuery .Query
506574
507575 inlineConf := tgbotapi.InlineConfig {
0 commit comments