|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * This file is part of the TelegramBot package. |
| 4 | + * |
| 5 | + * (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com> |
| 6 | + * |
| 7 | + * For the full copyright and license information, please view the LICENSE |
| 8 | + * file that was distributed with this source code. |
| 9 | + */ |
| 10 | + |
| 11 | +namespace Longman\TelegramBot\Entities\InputMedia; |
| 12 | + |
| 13 | +use Longman\TelegramBot\Entities\Entity; |
| 14 | + |
| 15 | +/** |
| 16 | + * Class InputMediaAudio |
| 17 | + * |
| 18 | + * @link https://core.telegram.org/bots/api#inputmediaaudio |
| 19 | + * |
| 20 | + * <code> |
| 21 | + * $data = [ |
| 22 | + * 'media' => '123abc', |
| 23 | + * 'thumb' => '456def', |
| 24 | + * 'caption' => '*Audio* caption', |
| 25 | + * 'parse_mode' => 'markdown', |
| 26 | + * 'duration' => 42, |
| 27 | + * 'performer' => 'John Doe', |
| 28 | + * 'title' => 'The Song', |
| 29 | + * ]; |
| 30 | + * </code> |
| 31 | + * |
| 32 | + * @method string getType() Type of the result, must be audio |
| 33 | + * @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. |
| 34 | + * @method string getThumb() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » |
| 35 | + * @method string getCaption() Optional. Caption of the audio to be sent, 0-200 characters |
| 36 | + * @method string getParseMode() Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
| 37 | + * @method int getDuration() Optional. Duration of the audio in seconds |
| 38 | + * @method string getPerformer() Optional. Performer of the audio |
| 39 | + * @method string getTitle() Optional. Title of the audio |
| 40 | + * |
| 41 | + * @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. |
| 42 | + * @method $this setThumb(string $thumb) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » |
| 43 | + * @method $this setCaption(string $caption) Optional. Caption of the audio to be sent, 0-200 characters |
| 44 | + * @method $this setParseMode(string $parse_mode) Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
| 45 | + * @method $this setDuration(int $duration) Optional. Duration of the audio in seconds |
| 46 | + * @method $this setPerformer(string $performer) Optional. Performer of the audio |
| 47 | + * @method $this setTitle(string $title) Optional. Title of the audio |
| 48 | + */ |
| 49 | +class InputMediaAudio extends Entity implements InputMedia |
| 50 | +{ |
| 51 | + /** |
| 52 | + * InputMediaAudio constructor |
| 53 | + * |
| 54 | + * @param array $data |
| 55 | + * |
| 56 | + * @throws \Longman\TelegramBot\Exception\TelegramException |
| 57 | + */ |
| 58 | + public function __construct(array $data = []) |
| 59 | + { |
| 60 | + $data['type'] = 'audio'; |
| 61 | + parent::__construct($data); |
| 62 | + } |
| 63 | +} |
0 commit comments