Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. if($bot->callback_data == 'livechat'){
  2. $query = $pdo->prepare("SELECT * FROM livechat WHERE id = ?");
  3. $query->execute([$bot->callback_user_id]);
  4. if(!$query->rowCount()){
  5. $pdo->prepare("INSERT INTO livechat (id, livechat) VALUES (?,?)")->execute(["$bot->callback_user_id",0]);
  6. $tastiera = '[{"text":"↩️Esci", "callback_data":"leftchat"}]';
  7. $bot->editMessageText($bot->callback_user_id,$bot->callback_message_id,"<b>Sei entrato in chat</b>",$tastiera,'inline');
  8. }else{
  9. $bot->sendMessage($bot->callback_user_id,"❌Sei già in chat❌");
  10. }
  11.  
  12. die;
  13. }
  14.  
  15.  
  16.  
  17. if($bot->text and $bot->tipo_chat == "private"){
  18. $controllo = $pdo->prepare("SELECT * FROM livechat WHERE id = ?");
  19. $controllo->execute([$bot->user_id]);
  20. if(!$controllo->rowCount()){
  21. $lc = false;
  22. }else{
  23. $lc = true;
  24. }
  25. if($lc and !$bot->text == "/start"){
  26. $admin = "701253371";
  27. forwardMessage($admin, $bot->user_id, $bot->message_id);
  28. sendMessage($admin, "#ID$bot->user_id");
  29. die;
  30. }
  31. else{
  32. if($bot->user_id == "701253371" || $bot->text == "/start"){
  33. }
  34. else{
  35. sendMessage($bot->user_id, "Entra in chat GHEI!");
  36. die;
  37. }
  38. }
  39. }
  40. if($bot->user_id == "701253371" and $bot->tipo_chat == "private"){
  41. $mex = explode('#ID', $bot->reply_text);
  42. $fix = explode(' ', $mex[1]);
  43. $mes = $fix[0];
  44. if($mes == "" and $bot->tipo_chat == "private"){
  45. sendMessage($bot->chat_id_reply_forward,$bot->text);
  46. die;
  47. }
  48. else{
  49. sendMessage($mes,$bot->text);
  50. die;
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement