too tired to desc
too tired to desc
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
PluginList("echo", "Echo what you typed.");
|
||||
if (preg_match("/^".TAG."echo (.*)$/", $_GET['text'], $matches)) {
|
||||
$BOT->exec("msg ".$from." ".$matches[1]);
|
||||
$BOT->exec("msg ".$from." ".escapeString($matches[1]));
|
||||
}
|
||||
+3
-3
@@ -12,9 +12,9 @@ if (preg_match("/^".TAG."trans (.*)$/", $_GET['text'], $matches)) {
|
||||
$to = $matches[0];
|
||||
$text = urlencode($matches[1]);
|
||||
}
|
||||
$trans = file_get_contents('http://api.microsofttranslator.com/v2/ajax.svc/TranslateArray2?appId=%22TKT68kjRgkUbVtIKst6Vo0Hxnb6g2f0K3tUMyn1gZ7nc*%22&to="'.$to.'"&options={}&texts=["'.$text.'"]');
|
||||
preg_match('/"TranslatedText":"([^"]+)/i', $trans, $trans_result);
|
||||
$msg = "Result: ".$trans_result[1];
|
||||
$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));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user