telegramBot::sendVoice PHP Method

sendVoice() public method

Send Voice.
public sendVoice ( integer $chat_id, string $audio, integer $duration = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$audio string
$duration integer
$reply_to_message_id integer
$reply_markup KeyboardMarkup
return Array
    public function sendVoice($chat_id, $audio, $duration = null, $reply_to_message_id = null, $reply_markup = null)
    {
        $data = compact('chat_id', 'audio', 'duration', 'reply_to_message_id', 'reply_markup');
        if (!is_dir($video) && filter_var($video, FILTER_VALIDATE_URL) === FALSE) {
            return $this->sendRequest('sendVoice', $data);
        }
        return $this->uploadFile('sendVoice', $data);
    }