Remove reply from send_code function.

This commit is contained in:
Ceda EI 2018-04-03 19:23:53 +05:30
parent fa39901f8e
commit d8b8693a43
1 changed files with 1 additions and 10 deletions

View File

@ -7,20 +7,11 @@ if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error); die("Connection failed: " . $conn->connect_error);
} }
function send_code($post_message, $reply=false) { function send_code($post_message) {
global $decoded;
global $bot_api; global $bot_api;
global $chat_id; global $chat_id;
$url = 'https://api.telegram.org/bot' . $bot_api . '/sendMessage'; $url = 'https://api.telegram.org/bot' . $bot_api . '/sendMessage';
$post_msg = array('chat_id' => $chat_id, 'text' => '```\n ' . $post_message . '```', 'parse_mode' => 'markdown' ); $post_msg = array('chat_id' => $chat_id, 'text' => '```\n ' . $post_message . '```', 'parse_mode' => 'markdown' );
if ($reply != false) {
if ($reply === true){
$post_msg['reply_to_message_id'] = $decoded->{'message'}->{'message_id'};
}
else {
$post_msg['reply_to_message_id'] = $reply;
}
}
$options = array( $options = array(
'http' => array( 'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'header' => "Content-type: application/x-www-form-urlencoded\r\n",