Guest User

Untitled

a guest
Jan 16th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2. $botToken="<MY_DESTINATION_BOT_TOKEN_HERE>";
  3.  
  4. $website="https://api.telegram.org/bot".$botToken;
  5. $chatId=1234567; //Receiver Chat Id
  6. $params=[
  7. 'chat_id'=>$chatId,
  8. 'text'=>'This is my message !!!',
  9. ];
  10. $ch = curl_init($website . '/sendMessage');
  11. curl_setopt($ch, CURLOPT_HEADER, false);
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  13. curl_setopt($ch, CURLOPT_POST, 1);
  14. curl_setopt($ch, CURLOPT_POSTFIELDS, ($params));
  15. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  16. $result = curl_exec($ch);
  17. curl_close($ch);
  18. ?>
Add Comment
Please, Sign In to add comment