usage: msg($peer, $text)
This commit is contained in:
+1
-1
@@ -15,6 +15,6 @@ if (preg_match("/^".TAG."trans (.*)$/", $_GET['text'], $matches)) {
|
||||
$trans = file_get_contents('http://api.microsofttranslator.com/v2/ajax.svc/TranslateArray2?appId=%22TWQET6TO9c7Iw1yXOahFm8zfEzty5DUHuaTHkl5SCrHUPgu3ABP7aflbz8teet6IS%22&to="'.$to.'"&options={}&texts=["'.$text.'"]');
|
||||
preg_match("/\[{.*?\}]/is", $trans, $trans_json);
|
||||
$msg = "Result: ".json_decode($trans_json[0],true)[0]["TranslatedText"];
|
||||
$BOT->exec("msg ".$from." ".escapeString($msg));
|
||||
$BOT->msg($from, $msg);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user