D-Bot/classes/Telegram/init.php
Denny Dai e321324785 Bot Api Version
Bot Api Version
2015-06-29 22:13:58 +08:00

20 lines
384 B
PHP

<?php
$BOT = new DBot\Base('unix:///tmp/tg.sck');
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));
}
$text = $_GET['text'];
}