submit many articles
boyzoon opened this issue · comments
|boyzoon| commented
can you help me to find out why when i use this code the bot does not return any results?
int cont = 0;
InlineQueryResultArticle[] results = new InlineQueryResultArticle[50];
for ( Article article : json.articles ){
results[cont] = new InlineQueryResultArticle(article.id , article.name , article.url).hideUrl(false).description(article.description).thumbUrl(article.iconUrl);
cont++;
}
bot.execute(new AnswerInlineQuery( message.inlineQuery().id() , results ));
but when i use it this way it works. the problem is that this way I can send only one article and I need to send all those in the "results" variable
bot.execute(new AnswerInlineQuery( message.inlineQuery().id() , new InlineQueryResult[]{results[0]} ));
|boyzoon| commented
hi?
Stas Parshin commented
I don't know why.
The similar test code was working fine.
I suggest you to debug API requests and responses and check HTTP logs.
bot = new TelegramBot.Builder(token()).debug().build();