Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'bot.php';
- $bot = new bot('997619542:AAFTqpUU0gcxZ69Es9FQBkQ6jv52FUcWFu4');
- $dsn = 'mysql:host=localhost;dbname=testdb';
- $user = 'Jaco';
- $password = 'MyNameIsNick28346L';
- try {
- $pdo = new PDO("mysql:host=localhost;dbname=test_db", $user, $password);
- }catch(PDOException $e){
- $bot->sendMessage('-1001181417607','Connection failed: ' . $e->getMessage());
- }
- if($bot->text){
- $query = $pdo->prepare("SELECT * FROM Utenti WHERE user_id = ?")->execute([$bot->user_id]);
- if($query->rowCount() == 0){
- $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]);
- }
- }
- if($bot->callback_data == ''){
- $tastiera = '[{"text":"AE","url":"adriapp.it"}]';
- $bot->editMessageText($bot->callback_user_id,$bot->callback_message_id,'TESTO NUOVO',$tastiera,'inline');
- }
- if($bot->text == 'ciao'){
- $bot->sendMessage($bot->user_id,"ciao");
- die;
- }
- if($bot->text == '/start'){
- $tastiera = '["info", "bho"],["ma"]';
- $bot->sendMessage($bot->user_id,"ok",$tastiera,'fisica');
- die;
- }
- if($bot->text == 'ma'){
- $bot->sendMessage($bot->user_id,"adriapp merda");
- die;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement