The following data structures represents custom keypad menus with reply options
Field | Type | Required | Description |
method | String | Yes | "inlineSearchAnswer" |
to_user_id | String | Yes | The user id you want to send to him. |
results | Yes | Array of media information. | |
next_offset | String | Yes | Pass the offset that a client should send in the next search with the same text to receive more results.
Pass an empty string if there are no more results or if you don't support pagination. |
chat_id | String | Yes | Chat id. |
search_id | String | Yes | Unique id of this message. |
Results
Field | Type | Required | Description |
thumb_url | String | Optional | URL of the media's thumbnail. |
caption | String | Optional | Caption of the media. |
description | String | Optional | Description of the media. |
title | String | Optional | Title of the media. |
type | String | Yes | |
url | String | Yes | Download URL of media file. |
width | Long | Optional | Width of thumbnail image. |
height | Long | Optional | Height of thumbnail image. |
Requests
json{ "method": "inlineSearchAnswer", "results": [{ "title": "Sports", "caption": "Football Match", "height": 10, "width": 40, "description": "Team 1 VS Team 2" } ], "next_offset": "News", "chat": { "id": "90089668723575679", "type": "Mobile" }, "to_user_id": "90089668723575679", "search_id": 1589 }
javaInlineSearchAnswer inlineSearchAnswer = new InlineSearchAnswer(); inlineSearchAnswer.setChatId(incomingMsg.getChat().getId()); inlineSearchAnswer.setToUserId(incomingMsg.getFrom().getId()); inlineSearchAnswer.setSearchId(1); Result results = new Result(); results.setId("8b6229eefde75174b6cb5474b38e7f2f55a280a17ccc1f18a3ed6f5416890070.mp4"); results.setCaption("test Video caption"); results.setDescription("Test Video desc"); results.setTitle("Test Video title"); Result results2 = new Result(); results2.setId("d2ba4e79f2e240d145e8be48f1ef98ece2f283193bce80f1b7ddbd0e8daae23a.gif"); results2.setCaption("test GIF caption"); results2.setDescription("Test GIF desc"); results2.setTitle("Test GIF title"); Result results3 = new Result(); results3.setId("4bdb5b65838706092cff9de33694641aa0b7a02899b0884d07df2f58374bf40d.jpg"); results3.setCaption("test Photo caption"); results3.setDescription("Test Photo desc"); results3.setTitle("Test Photo title"); ArrayList<Result> multiResults = new ArrayList<Result>(); multiResults.add(results3); multiResults.add(results2); multiResults.add(results); inlineSearchAnswer.setResults(multiResults); api.send(inlineSearchAnswer);
javascriptlet inlineSearchAnswer = new InlineSearchAnswer(); inlineSearchAnswer.chatId = incomingMsg.chat.id; inlineSearchAnswer.toUserId = incomingMsg.from.id; inlineSearchAnswer.searchId = 1; let results = new Result(); results.id = "8b6229eefde75174b6cb5474b38e7f2f55a280a17ccc1f18a3ed6f5416890070.mp4"; results.caption = "test Video caption"; results.description = "Test Video desc"; results.title = "Test Video title"; let results2 = new Result(); results2.id = "d2ba4e79f2e240d145e8be48f1ef98ece2f283193bce80f1b7ddbd0e8daae23a.gif"; results2.caption = "test GIF caption"; results2.description = "Test GIF desc"; results2.title = "Test GIF title"; let results3 = new Result(); results3.id = "4bdb5b65838706092cff9de33694641aa0b7a02899b0884d07df2f58374bf40d.jpg"; results3.caption = "test Photo caption"; results3.description = "Test Photo desc"; results3.title = "Test Photo title"; let multiResults = []; multiResults.push(results3); multiResults.push(results2); multiResults.push(results); inlineSearchAnswer.results(multiResults); api.send(inlineSearchAnswer);
Response
json{ "method": "inlineSearch", "inlineSearch": { "date": 1559491192232, "keywords": "hi", "chat": { "id": "90089585282313728", "type": "Mobile" }, "from": { "id": "90089585282313728", "type": "Mobile" }, "search_id": 3329 } }