diff --git a/config.inc.php b/config.inc.php index f2589d5..1ac0385 100644 --- a/config.inc.php +++ b/config.inc.php @@ -2,3 +2,5 @@ define('TAG', '#'); define('OWNER_NAME', 'Denny Dai'); define('BOT_NAME', 'Dx. Dennx'); +define('HELP_BEGIN', "Welcome to use TG-BOT"); +define('HELP_END', "GitHub: https://github.com/dennydai/D-bot\nAuthor: @DennyDai"); diff --git a/init.php b/init.php index b3d7619..67b8147 100644 --- a/init.php +++ b/init.php @@ -4,21 +4,7 @@ require_once('config.inc.php'); require_once('functions.php'); $plugins = []; -if($_GET['from'] != escapePeer(BOT_NAME)){ -//is group? - if ($_GET['to'] == escapePeer(BOT_NAME)) { - $isgroup = false; - }else{ - $isgroup = true; - } - -//reply to... - if ($isgroup) { - $from = $_GET['to']; - }else{ - $from = $_GET['from']; - $BOT->exec("msg ".escapePeer(OWNER_NAME)." ".json_encode($_GET)); - } +$from = $_GET['from'] //load plugins $load_plugins = glob(dirname(__FILE__).DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'*.php'); diff --git a/plugins/help.php b/plugins/help.php index e89f1bf..6b4248f 100644 --- a/plugins/help.php +++ b/plugins/help.php @@ -1,9 +1,10 @@ exec("msg ".$from." ".escapeString($plugin_list)); } \ No newline at end of file diff --git a/readmes/Telegram/Telegram.py b/readmes/Telegram/Telegram.py new file mode 100644 index 0000000..f0530b0 --- /dev/null +++ b/readmes/Telegram/Telegram.py @@ -0,0 +1,11 @@ +#coding:utf-8 +import tgl +import urllib +import urllib2 + +def on_msg_receive(msg): + get="from="+urllib.quote(msg.dest.name)+"&text="+urllib.quote(msg.text) + url="http://1.vps.dennx.com/onmessage.php?" + req=urllib2.Request(url+get) + res=urllib2.urlopen(req).read() + print res \ No newline at end of file