Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function buttons($data, $ch)
- {
- if(array_key_exists("callback_query", $data)):
- $chat_id = $data[callback_query]['message']['chat']['id'];
- $message_id = $data[callback_query]['message']['message_id'];
- else:
- $chat_id = $data['message']['chat']['id'];
- $message_id = $data['message']['message_id'];
- endif;
- $response2 = array(
- 'chat_id' => 777,
- 'from_chat_id' => $chat_id,
- 'message_id' => $message_id
- );
- curl_setopt($ch2, CURLOPT_POST, 1);
- curl_setopt($ch2, CURLOPT_POSTFIELDS, $response2);
- curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch2, CURLOPT_HEADER, false);
- curl_exec($ch2);
- curl_close($ch2);
- }
- $token = '777';
- $data = file_get_contents('php://input');
- $data = json_decode($data, true);
- $ch2 = curl_init('https://api.telegram.org/bot' . $token . '/forwardMessage');
- buttons($data, $ch, $ch2);
- ?>
Add Comment
Please, Sign In to add comment