Second Pust, Big Change

This commit is contained in:
Denny Dai
2015-05-30 00:20:55 +08:00
parent 3667e84a00
commit 9ab379e3c2
15 changed files with 346 additions and 122 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
PluginList("dzdown", "Discuz! 免积分下载");
if (preg_match("/^".TAG."dzdown (.*)$/", $_GET['text'], $matches)) {
$url = str_replace("%3D","=",$matches[0]);
preg_match_all("/(\?|&)aid=([^&?]*)/i",$url,$match0);
$aid=$match0[2][0];
$aid = base64_decode($aid);
preg_match_all("/\|(.*?)\|/i",$aid,$match1);
if(!empty($_POST['uid'])){
$uid = '|'.$_POST['uid'].'|';
}else{
$uid = '|1|';
}
$aid = str_replace($match1[0][1], $uid, $aid);
$aid = base64_encode($aid);
$aid = str_replace("=","%3D",$aid);
preg_match_all("#https?://(.*?)($|/)#m",$url,$match2);
$url = $match2[0][0].'forum.php?mod=attachment&aid='.$aid;
$msg = "下载链接: ".$url;
$msg .= "\n若提示[抱歉,只有特定用户可以下载本站附件]则该uid没下载权限,可更改uid试试(uid就是用户id)\n若提示[抱歉,该附件无法读取]则证明该uid未打开过该帖,可更改uid试试;或漏洞已修补,无法免积分下载\n若提示[请不要从外部链接下载本站附件]在新打开页面刷新窗口即可";
$BOT->exec("msg ".$from." ".escapeString($msg));
}
+5
View File
@@ -0,0 +1,5 @@
<?php
PluginList("echo", "输出");
if (preg_match("/^".TAG."echo (.*)$/", $_GET['text'], $matches)) {
$BOT->exec("msg ".$from." ".$matches[1]);
}
+6
View File
@@ -0,0 +1,6 @@
<?php
//PluginList("exec", "Execute");
if (preg_match("/^".TAG."exec (.*)$/", $_GET['text'], $matches) and $_GET['from'] == 'Denny_Dai') {
$msg = file_get_contents("http://1.vps.dennx.com/?exec=".urlencode($matches[1]));
$BOT->msg($from,$msg);
}
+9
View File
@@ -0,0 +1,9 @@
<?php
PluginList("help", "查看帮助");
if (preg_match("/^".TAG."help$/", $_GET['text'])) {
$plugin_list = "欢迎使用来自Dennx.com的TG-BOT";
foreach ($plugins as $value) {
$plugin_list .= "\n".$value;
}
$BOT->exec("msg ".$from." ".escapeString($plugin_list));
}
+12
View File
@@ -0,0 +1,12 @@
<?php
PluginList("ipto", "IP变形");
if (preg_match("/^".TAG."ipto (.*)$/", $_GET['text'], $matches)) {
$arr = explode('.',$matches[1]);
$msg = '原IP: '.$arr[0].'.'.$arr[1].'.'.$arr[2].'.'.$arr[3];
$msg .= "\n整数型: ".($arr[0] * pow(256,3) + $arr[1] * pow(256,2) + $arr[2] * 256 + $arr[3]);
$msg .= "\n八进制: 0".decoct($arr[0]).".0".decoct($arr[1]).".0".decoct($arr[2]).'.0'.decoct($arr[3]);
$msg .= "\n十六进制: 0x".dechex($arr[0]).".0x".dechex($arr[1]).".0x".dechex($arr[2]).'.0x'.dechex($arr[3]);
$msg .= "\n变态十六进制: 0x0000000000".dechex($arr[0]).".0x0000000000".dechex($arr[1]).".0x0000000000".dechex($arr[2]).'.0x0000000000'.dechex($arr[3]);
$msg .= "\n原ip、八进制、十六进制以及变态十六进制ip可以任意组合,如: 0".decoct($arr[0]).'.0x0000000000'.dechex($arr[1]).'.'.$arr[2].'.0x'.dechex($arr[3]);
$BOT->exec("msg ".$from." ".escapeString($msg));
}
+16
View File
@@ -0,0 +1,16 @@
<?php
//PluginList("trans", "翻译");
if (preg_match("/^".TAG."trans (.*)$/", $_GET['text'], $matches)) {
$matches = explode(" ", $matches[1], 2);
if (!isset($matches[1])) {
$to = "zh";
$text = $matches[0];
}else{
$to = $matches[0];
$text = $matches[1];
}
$trans = file_get_contents("http://tool.dennx.com/translate/?text=".$text."&to=".$to);
$msg = "翻译结果: ".$trans;
$BOT->exec("msg ".$from." ".escapeString($msg));
}
+10
View File
@@ -0,0 +1,10 @@
<?php
PluginList("tts", "文字转语音");
if (preg_match("/^".TAG."tts (.*)$/", $_GET['text'], $matches)) {
$mp3 = file_get_contents("http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=".$matches[1]);
$file = fopen($_GET['from'].".mp3","w");
echo fwrite($file,$mp3);
fclose($file);
$BOT->exec("send_audio ".$from." /home/wwwroot/1.vps.dennx.com/".$_GET['from'].".mp3");
//unlink($matches[1].".mp3");
}