BimoSora

bottelegramcurl

Oct 12th, 2020 (edited)
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2. $TOKEN = "tokenbot";
  3. $trustedgroup = "-idgroup";
  4.  
  5. //promosi
  6. $promosi = "Ayo promosikan grup ini dan channelnya";
  7. $url = 'https://api.telegram.org/bot'.$TOKEN.'/sendMessage';
  8.  
  9. $parameters = [
  10. 'chat_id' => $trustedgroup,
  11. 'text' => $promosi,
  12. 'parse_mode' => 'html',
  13. 'disable_web_page_preview' => true,
  14. ];
  15.  
  16. $link = $url . '?' . http_build_query($parameters);
  17.  
  18. // persiapkan curl
  19. $ch = curl_init();
  20. // set url
  21. curl_setopt($ch, CURLOPT_URL, $link);
  22. // return the transfer as a string
  23. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  24. // $output contains the output string
  25. $output = curl_exec($ch);
  26. // tutup curl
  27. curl_close($ch);
  28. ?>
Add Comment
Please, Sign In to add comment