404

[ Avaa Bypassed ]




Upload:

Command:

botdev@13.59.84.174: ~ $
<?php 
class Speech extends BaseSerevice {
        public $callBackData;
	function  __construct(TranslateService $TG, $callbackData){
                parent::__construct($TG);
		$this->callBackData = $callbackData;
	}
	function listen(){
                
                if($this->callBackData[0] != EnumSpeech::SPEECH_GET_SOUND){
                        return false;
                }
                $word = $this->callBackData[1];
                
                 $soundLink = $this->getTG()->getTTS()->getSoundFromGoogle($word);
                // if(!file_exists($soundLink)){
                //      $voice = $this->TG->getSpeech ($word);
                //         if(!isset($voice ['error'])){
                //                 $soundFile= $this->TG->normalizeGermanWord($word).".mp3";
                //                 file_put_contents (  "sounds/" . $soundFile, $voice ['response'] );
                //         }
                //         else{
                //                     $this->TG->sendMessage ("error".$voice ['error']);
                //         }
                // }
                // $result = $this->TG->apiRequestWebhook("sendAudio", array(
                // $this->getTG()->sendMessageLog($soundLink);
                $chatId = $this->getTG()->chat_id;
                $this->getTG()->getBot()->setTG($this->getTG());
                // print_r($soundLink);
                // $result = $this->getTG()->getBot()->apiRequestJson("sendAudio", array(
                // 'chat_id' => $chatId,
                // "audio" => $soundLink,
                // 'caption' => "@TranslateGerman_bot" . PHP_EOL . " تلفظ  " . $word
                // ));                  
                 $result = $this->getTG()->getBot()->apiRequestJson("sendVoice", array(
                'chat_id' => $chatId,
                "voice" => $soundLink,
                'caption' => "@TranslateGerman_bot" . PHP_EOL . " تلفظ  " . $word
                ));   
                // $this->getTG()->sendMessageLog(var_export($result, true) );           
                return $textCallback = "تلفظ ارسال شد";
	}
    
    /*
     * 
     * 			if($callBackData[0] == "task" && $callBackData[1] == "translate"){
				
// 				$key = "trnsl.1.1.20161227T200147Z.ea68ee52a784814b.d57d90672c621ed4b707e054a845d8e0367ad95d";
// 				$translated = file_get_contents("https://translate.yandex.net/api/v1.5/tr.json/translate?key="
// 				 		.$key."&lang=de-fa&text=abmachen");
				$key="trnsl.1.1.20161227T200147Z.ea68ee52a784814b.d57d90672c621ed4b707e054a845d8e0367ad95d";
				$translator = new Translator($key);
				$message = $translator->translate($this->message['text'], "de-fa");


			}
			else 
     * 
     */
}

?>

Filemanager

Name Type Size Permission Actions
Speech.php File 2.73 KB 0755