getInlineQuery(); $query = $inline_query->getQuery(); $results = []; if ($query !== '') { // https://core.telegram.org/bots/api#inlinequeryresultarticle $results[] = new InlineQueryResultArticle([ 'id' => '001', 'title' => 'Simple text using InputTextMessageContent', 'description' => 'this will return Text', // Here you can put any other Input...MessageContent you like. // It will keep the style of an article, but post the specific message type back to the user. 'input_message_content' => new InputTextMessageContent([ 'message_text' => 'The query that got you here: ' . $query, ]), ]); // https://core.telegram.org/bots/api#inlinequeryresultcontact $results[] = new InlineQueryResultContact([ 'id' => '002', 'phone_number' => '12345678', 'first_name' => 'Best', 'last_name' => 'Friend', ]); // https://core.telegram.org/bots/api#inlinequeryresultlocation $results[] = new InlineQueryResultLocation([ 'id' => '003', 'title' => 'The center of the world!', 'latitude' => 40.866667, 'longitude' => 34.566667, ]); // https://core.telegram.org/bots/api#inlinequeryresultvenue $results[] = new InlineQueryResultVenue([ 'id' => '004', 'title' => 'No-Mans-Land', 'address' => 'In the middle of Nowhere', 'latitude' => 33, 'longitude' => -33, ]); } return $inline_query->answer($results); } }