Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- echo"Está página web no tiene nada xD";
- $botToken = "AQUI API TELEGRAM";
- $website = "https://api.telegram.org/bot".$botToken;
- $update = file_get_contents('php://input');
- $update = json_decode($update, TRUE);
- $chatId = $update["message"]["chat"]["id"];
- $nombre = $update['message']['from']['first_name'];
- $chatType = $update["message"]["chat"]["type"];
- $message = $update["message"]["text"];
- $arr = explode(' ',trim($message));
- $command = $arr[0];
- $message = substr(strstr($message," "), 1);
- //No requieren variables del usuario.
- switch ($command) {
- case "/binario";
- $response = file_get_contents("https://todocodigos.000webhostapp.com/binario/binario.php?binario=$message");
- Binario($chatId, $response);
- break;
- case "/texto";
- $response = file_get_contents("https://todocodigos.000webhostapp.com/binario/texto.php?texto=$message");
- texto($chatId, $response);
- break;
- }
- function Binario($chatId, $response)
- {
- $url = "$GLOBALS[website]/sendMessage?chat_id=$chatId&parse_mode=HTML&text=".urlencode($response);
- file_get_contents($url);
- }
- function texto($chatId, $response)
- {
- $url = "$GLOBALS[website]/sendMessage?chat_id=$chatId&parse_mode=HTML&text=".urlencode($response);
- file_get_contents($url);
- }
- $esempiotastierainline = '[{"text":"Suscribete en youtube","url":"http://youtube.com/user/irokehabbo"},{"text":"Sigueme en twitter","url":"https://twitter.com/jose89yt"}]';
- switch($command){
- case "/start":
- sendMessage1($chatId,"Hola $nombre, bienvenidos a la herramienta de youtube");
- case "/start":
- sendMessage1($chatId,"Sigueme en youtube y en twitter clicando aquí abajo ⬇️️",$esempiotastierainline,"inline");
- break;
- }
- function sendMessage1($chatId,$text,$tastiera,$tipo){
- if(isset($tastiera)){
- if($tipo == "fisica"){
- $tastierino = '&reply_markup={"keyboard":['.urlencode($tastiera).'],"resize_keyboard":true}';
- }
- else {
- $tastierino = '&reply_markup={"inline_keyboard":['.urlencode($tastiera).'],"resize_keyboard":true}';
- }
- }
- $url = $GLOBALS[website]."/sendMessage?chat_id=$chatId&parse_mode=HTML&text=".urlencode($text).$tastierino;
- file_get_contents($url);
- }
- function answerQuery($callback_query_id,$text){
- $url = $GLOBALS[website]."/answerCallbackQuery?callback_query_id=$callback_query_id&text=".urlencode($text);
- file_get_contents($url);
- }
- function editMessageText($chatId,$message_id,$newText)
- {
- $url = $GLOBALS[website]."/editMessageText?chat_id=$chatId&message_id=$message_id&parse_mode=HTML&text=".urlencode($newText);
- file_get_contents($url);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement