D-Bot/classes/Telegram-Bot/init.php

22 lines
439 B
PHP
Raw Normal View History

2015-06-29 09:13:58 -05:00
<?php
2015-07-08 03:13:12 -05:00
$BOT = new Base;
2015-06-29 09:13:58 -05:00
$GET = json_decode(file_get_contents("php://input"),true);
//is group?
if ($GET['message']['chat']['id'] > 0) {
$isgroup = false;
}else{
$isgroup = true;
}
2016-05-17 03:27:08 -05:00
2015-06-29 09:13:58 -05:00
//reply to...
2016-01-02 05:53:39 -06:00
$msgid = $GET['message']['message_id'];
2015-06-29 09:13:58 -05:00
$from = $GET['message']['chat']['id'];
2016-05-17 03:27:08 -05:00
$date = $GET['message']['date'];
2016-06-27 02:07:06 -05:00
if ((time() - $date) > 10) {
2016-05-17 03:27:08 -05:00
$text = 'unset';
}else {
$text = $GET['message']['text'];
}
2016-01-02 05:53:39 -06:00
define('MSGID',$msgid);