PHP Class TelegramBot\Api\Types\Inline\QueryResult\Voice

See also: https://core.telegram.org/bots/api#inlinequeryresultvoice Represents a link to an mp3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use InputMessageContent to send a message with the specified content instead of the audio. Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
Inheritance: extends AbstractInlineQueryResult
显示文件 Open project: TelegramBot/Api

Protected Properties

Property Type Description
$map array
$requiredParams array
$type string
$voiceDuration integer Optional. Audio duration in seconds
$voiceUrl string A valid URL for the audio file

Public Methods

Method Description
__construct ( string $id, string $voiceUrl, string $title, integer | null $voiceDuration = null, TelegramBot\Api\Types\Inline\InlineKeyboardMarkup | null $inlineKeyboardMarkup = null, TelegramBot\Api\Types\Inline\InputMessageContent | null $inputMessageContent = null ) Voice constructor
getVoiceDuration ( ) : integer
getVoiceUrl ( ) : string
setVoiceDuration ( integer $voiceDuration )
setVoiceUrl ( string $voiceUrl )

Method Details

__construct() public method

Voice constructor
public __construct ( string $id, string $voiceUrl, string $title, integer | null $voiceDuration = null, TelegramBot\Api\Types\Inline\InlineKeyboardMarkup | null $inlineKeyboardMarkup = null, TelegramBot\Api\Types\Inline\InputMessageContent | null $inputMessageContent = null )
$id string
$voiceUrl string
$title string
$voiceDuration integer | null
$inlineKeyboardMarkup TelegramBot\Api\Types\Inline\InlineKeyboardMarkup | null
$inputMessageContent TelegramBot\Api\Types\Inline\InputMessageContent | null

getVoiceDuration() public method

public getVoiceDuration ( ) : integer
return integer

getVoiceUrl() public method

public getVoiceUrl ( ) : string
return string

setVoiceDuration() public method

public setVoiceDuration ( integer $voiceDuration )
$voiceDuration integer

setVoiceUrl() public method

public setVoiceUrl ( string $voiceUrl )
$voiceUrl string

Property Details

$map protected_oe static_oe property

protected static array $map
return array

$requiredParams protected_oe static_oe property

protected static array $requiredParams
return array

$type protected_oe property

protected string $type
return string

$voiceDuration protected_oe property

Optional. Audio duration in seconds
protected int $voiceDuration
return integer

$voiceUrl protected_oe property

A valid URL for the audio file
protected string $voiceUrl
return string