Advertisement
ghiwar

Welcome Bot Telegram

Nov 21st, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. function doPost(e) {
  2. var token = "xxxxxx";
  3.  
  4. var stringJson = e.postData.getDataAsString();
  5.  
  6. var updates = JSON.parse(stringJson);
  7. var chatid = updates.message.chat.id;
  8. if(isContainText(updates)) {
  9. var text = "Hello "+updates.message.from.first_name+", IPTV list link available on Pinned Post, please check!!!\n\n Before start please download our app here => https://bit.ly/3fgNqZy.\n\n How to use? Check tutorial here => https://t.me/tigeriptv/238";
  10. } else if(isContainNewMember(updates)){
  11. var text = "Hello "+updates.message.new_chat_member.first_name+" welcome to Vola Sports IPTV Telegram Group, before start please download our app here => https://bit.ly/3fgNqZy.\n\n How to use? Check tutorial here => https://t.me/tigeriptv/238";
  12. }
  13. var url = "https://api.telegram.org/bot"+token+"/sendMessage?chat_id="+encodeURIComponent(chatid)+"&text="+encodeURIComponent(text);
  14. var replay = UrlFetchApp.fetch(url);
  15. }
  16.  
  17. function isContainText(updates) {
  18. if(updates.message.text == null){
  19. return false;
  20. } else {
  21. return true;
  22. }
  23. }
  24.  
  25. function isContainNewMember(updates){
  26. if(updates.message.new_chat_member == null){
  27. return false;
  28. } else{
  29. return true;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement