Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <?php
  2.  
  3. require 'bot.php';
  4.  
  5. $bot = new bot('997619542:AAFTqpUU0gcxZ69Es9FQBkQ6jv52FUcWFu4');
  6.  
  7.  
  8. $dsn = 'mysql:host=localhost;dbname=testdb';
  9. $user = 'Jaco';
  10. $password = 'MyNameIsNick28346L';
  11. try {
  12. $pdo = new PDO("mysql:host=localhost;dbname=test_db", $user, $password);
  13. }catch(PDOException $e){
  14. $bot->sendMessage('-1001181417607','Connection failed: ' . $e->getMessage());
  15. }
  16. if($bot->text){
  17. $query = $pdo->prepare("SELECT * FROM Utenti WHERE user_id = ?")->execute([$bot->user_id]);
  18. if($query->rowCount() == 0){
  19. $pdo->prepare("INSERT INTO utenti (nome,cognome,id,username,status,bl) VALUES (?,?)")->execute([$bot->nome,$bot->cognome,$bot->user_id,$bot->username,$bot->avviato,$bot->bl]);
  20. }
  21. }
  22. if($bot->callback_data == ''){
  23. $tastiera = '[{"text":"AE","url":"adriapp.it"}]';
  24. $bot->editMessageText($bot->callback_user_id,$bot->callback_message_id,'TESTO NUOVO',$tastiera,'inline');
  25. }
  26.  
  27. if($bot->text == 'ciao'){
  28. $bot->sendMessage($bot->user_id,"ciao");
  29. die;
  30. }
  31.  
  32. if($bot->text == '/start'){
  33. $tastiera = '["info", "bho"],["ma"]';
  34. $bot->sendMessage($bot->user_id,"ok",$tastiera,'fisica');
  35. die;
  36. }
  37.  
  38. if($bot->text == 'ma'){
  39. $bot->sendMessage($bot->user_id,"adriapp merda");
  40. die;
  41. }
  42.  
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement