// handler for getting an specific app's details
//
// id is target app's id to seek details for, bot is BotAPI, update is arrived telegram update
handler for getting an specific app's details

id is target app's id to seek details for, bot is BotAPI, update is arrived telegram update
// handler for getting an specific app ' s details // // id is target app ' s id to seek details for bot is BotAPI update is arrived telegram update
func handleSpecificId(id string, bot *tgbotapi.BotAPI, update tgbotapi.Update) {
	if handleSpecificIdByCache(id, bot, update) {
		return
	}
	resChan := make(chan []searchApi.AppleSearchAppInfo)
	go searchApi.LookupApp(resChan, id)
	results := <-resChan
	if results == nil || len(results) < 1 {
		msg := tgbotapi.NewMessage(update.Message.Chat.ID, "No result found.")
		msg.ReplyMarkup = tgbotapi.NewRemoveKeyboard(true)
		bot.Send(msg)
		return
	}
	msg := tgbotapi.NewMessage(update.Message.Chat.ID, getHtmlOfAppInfo(results[0]))
	msg.ParseMode = "HTML"
	msg.ReplyMarkup = tgbotapi.NewRemoveKeyboard(true)
	bot.Send(msg)
	saveResultsToCache(results)
}
func handleSpecificId ( id string , bot * tgbotapi . BotAPI , update tgbotapi . Update ) { if handleSpecificIdByCache ( id , bot , update ) { return } resChan := make ( chan [ ] searchApi . AppleSearchAppInfo ) go searchApi . LookupApp ( resChan , id ) results := <- resChan if results == nil || len ( results ) < 1 { msg := tgbotapi . NewMessage ( update . Message . Chat . ID , " " ) msg . ReplyMarkup = tgbotapi . NewRemoveKeyboard ( true ) bot . Send ( msg ) return } msg := tgbotapi . NewMessage ( update . Message . Chat . ID , getHtmlOfAppInfo ( results [ 0 ] ) ) msg . ParseMode = " " msg . ReplyMarkup = tgbotapi . NewRemoveKeyboard ( true ) bot . Send ( msg ) saveResultsToCache ( results ) }
handler for getting an specific app's details
handler for getting an specific app ' s details