Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $botToken = "Token";
- $website = "https://api.telegram.org/bot".$botToken;
- $update = file_get_contents('php://input');
- $update = json_decode($update, TRUE);
- $chatId = $update['message']['from']['id'];
- $nome = $update['message']['from']['first_name'];
- $text = $update['message']['text'];
- $agg = json_decode($update,JSON_PRETTY_PRINT);
- switch($text)
- {
- case "Info":
- sendMessage($chatId,"Se vuoi contattarci in privato per bug o errori su questo bot o altre cose:
- zio3: @zio (Founder)
- zio2: @zio (Admin)
- zio1: @zio (Admin)
- Per limitati: @HWHelpBot
- Mi raccomando, quando scrivete in privato avvisate che venite dal bot, o verrete spamreportati
- Grazie :D");
- break;
- case "Chi Sia?":
- sendMessage($chatId,"Noi siamo tre amici, che ci siamo conosciuti qui su telegram, e abbiamo deciso di aprire questo gruppo!");
- break;
- case "Male...":
- sendMessage($chatId,"Uh, mi dispiace... Che è successo?");
- break;
- default:
- $tastierabenvenuto = '["Info"],["Male..."],["Chi Sia?"]';
- sendMessage($chatId,"Ciao <b>$nome</b>!
- Questo bot ti darà info sul gruppo @HWGroupTech!
- Nel gruppo si parla di informatica, bot, programmazione, PC, configurazioni, elettronica... diciamo un pò di tutto!
- Clicca i vari pulsanti per avere altre info sul gruppo!",$tastierabenvenuto);
- break;
- }
- function sendMessage($chatId,$text,$tastiera)
- {
- if(isset($tastiera))
- {
- $tastierino = '&reply_markup={"keyboard":['.$tastiera.'],"resize_keyboard":true}';
- }
- $url = $GLOBALS[website]."/sendMessage?chat_id=$chatId&parse_mode=HTML&text=".urlencode($text).$tastierino;
- file_get_contents($url);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement