示例#1
0
文件: main.go 项目: Xe/trolling
func inlineHandler(bot *telebot.Bot) {
	for query := range bot.Queries {
		log.Printf("Helped @%s with printer facts!", query.From.Username)

		fact, err := GetPrinterFact()
		if err != nil {
			panic(err)
		}

		results := []telebot.Result{
			fact,
		}

		// And finally respond to the query:
		if err := bot.Respond(query, results); err != nil {
			log.Println("ouch:", err)
		}
	}
}