translate && del Redundant codes && some new var

This commit is contained in:
Denny Dai
2015-05-30 01:30:08 +08:00
parent 75c23b86e9
commit 2347defd47
10 changed files with 18 additions and 100 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
<?php
//PluginList("trans", "翻译");
//PluginList("trans", "translate");
if (preg_match("/^".TAG."trans (.*)$/", $_GET['text'], $matches)) {
$matches = explode(" ", $matches[1], 2);
if (!isset($matches[1])) {
@@ -10,7 +10,7 @@ if (preg_match("/^".TAG."trans (.*)$/", $_GET['text'], $matches)) {
$text = $matches[1];
}
$trans = file_get_contents("http://tool.dennx.com/translate/?text=".$text."&to=".$to);
$msg = "翻译结果: ".$trans;
$msg = "Result: ".$trans;
$BOT->exec("msg ".$from." ".escapeString($msg));
}