<?php
class TranslateInline extends Intent {
function init()
{
$this->name = "translateinline";
}
function act(){
$text = $this->data['inline_query']['query'];
$noHtmlTag = FALSE;
$translatedText = $this->getIS()->getTG()->getTranslatedText($text, $noHtmlTag);
$readyResult = [[
"type" => "article",
"id" => "0",
"title" => $text . " ترجمه",
"message_text" => $translatedText . PHP_EOL . "@TranslateGerman_bot",
"cache_time" => 1
]];
$this->getIS()->getTG()->apiRequest("answerInlineQuery", array(
'inline_query_id' => $this->getIS()->getTG()->inline_message_id,
'results' => $readyResult,
'cache_time' => 1,
"parse_mode" => "html",
));
}
}
?>