Skip to content

Commit 13f3185

Browse files
author
Syfaro
committed
Clean up some formatting.
1 parent 7f37376 commit 13f3185

File tree

2 files changed

+2
-70
lines changed

2 files changed

+2
-70
lines changed

bot_test.go

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -516,71 +516,3 @@ func ExampleAnswerInlineQuery() {
516516
}
517517
}
518518
}
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)
573-
article.Description = update.InlineQuery.Query
574-
575-
inlineConf := tgbotapi.InlineConfig{
576-
InlineQueryID: update.InlineQuery.ID,
577-
IsPersonal: true,
578-
CacheTime: 0,
579-
Results: []interface{}{article},
580-
}
581-
582-
if _, err := bot.AnswerInlineQuery(inlineConf); err != nil {
583-
log.Println(err)
584-
}
585-
}
586-
}

helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ func NewInlineQueryResultArticleMarkdown(id, title, messageText string) InlineQu
335335
ID: id,
336336
Title: title,
337337
InputMessageContent: InputTextMessageContent{
338-
Text: messageText,
338+
Text: messageText,
339339
ParseMode: "Markdown",
340340
},
341341
}
@@ -348,7 +348,7 @@ func NewInlineQueryResultArticleHTML(id, title, messageText string) InlineQueryR
348348
ID: id,
349349
Title: title,
350350
InputMessageContent: InputTextMessageContent{
351-
Text: messageText,
351+
Text: messageText,
352352
ParseMode: "HTML",
353353
},
354354
}

0 commit comments

Comments
 (0)