Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $botToken="<MY_DESTINATION_BOT_TOKEN_HERE>";
- $website="https://api.telegram.org/bot".$botToken;
- $chatId=1234567; //Receiver Chat Id
- $params=[
- 'chat_id'=>$chatId,
- 'text'=>'This is my message !!!',
- ];
- $ch = curl_init($website . '/sendMessage');
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, ($params));
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $result = curl_exec($ch);
- curl_close($ch);
- ?>
Add Comment
Please, Sign In to add comment