Longman\TelegramBot\Request::sendVoice PHP Method

sendVoice() public static method

Telegram clients will display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
public static sendVoice ( array $data, string $file = null ) : ServerResponse
$data array
$file string
return Longman\TelegramBot\Entities\ServerResponse
    public static function sendVoice(array $data, $file = null)
    {
        self::assignEncodedFile($data, 'voice', $file);
        return self::send('sendVoice', $data);
    }