add usage: send_audio($peer, $file)

This commit is contained in:
Denny Dai 2015-06-26 14:05:00 +08:00
parent c3ada33e3b
commit d0391f4a7e
2 changed files with 6 additions and 1 deletions

View File

@ -48,4 +48,9 @@ class Base
$msg = $this->escapeStringArgument($msg); $msg = $this->escapeStringArgument($msg);
return $this->exec('msg ' . $peer . ' ' . $msg); return $this->exec('msg ' . $peer . ' ' . $msg);
} }
public function send_audio($peer, $file)
{
$peer = $this->escapePeer($peer);
return $this->exec('send_audio ' . $peer . ' ' . $file);
}
} }

View File

@ -5,6 +5,6 @@ if (preg_match("/^".TAG."tts (.*)$/", $_GET['text'], $matches)) {
$file = fopen($_GET['from'].".mp3","w"); $file = fopen($_GET['from'].".mp3","w");
echo fwrite($file,$mp3); echo fwrite($file,$mp3);
fclose($file); fclose($file);
$BOT->exec("send_audio ".$from." /home/wwwroot/1.vps.dennx.com/".$_GET['from'].".mp3"); $BOT->send_audio($from, "/home/wwwroot/1.vps.dennx.com/".$_GET['from'].".mp3");
//unlink($matches[1].".mp3"); //unlink($matches[1].".mp3");
} }