Skip to content

Commit

Permalink
Accept InputFile for deeper attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
TiiFuchs committed May 11, 2022
1 parent ff84eef commit e1b2042
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Telegram/InputMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class InputMedia extends Type implements Factory
public string $type;

/** 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. More info on Sending Files » */
public string $media;
public string|\Tii\Telepath\Types\InputFile $media;

/** Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing */
public ?string $caption = null;
Expand Down
4 changes: 2 additions & 2 deletions src/Telegram/InputMediaAnimation.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class InputMediaAnimation extends InputMedia
public ?int $duration = null;

/**
* @param 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. More info on Sending Files »
* @param string|\Tii\Telepath\Types\InputFile $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. More info on Sending Files »
* @param \Tii\Telepath\Types\InputFile|string $thumb Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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 »
* @param string $caption Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing
* @param string $parse_mode Optional. Mode for parsing entities in the animation caption. See formatting options for more details.
Expand All @@ -37,7 +37,7 @@ class InputMediaAnimation extends InputMedia
* @param int $duration Optional. Animation duration in seconds
*/
public static function make(
string $media,
string|\Tii\Telepath\Types\InputFile $media,
\Tii\Telepath\Types\InputFile|string|null $thumb = null,
?string $caption = null,
?string $parse_mode = null,
Expand Down
4 changes: 2 additions & 2 deletions src/Telegram/InputMediaAudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class InputMediaAudio extends InputMedia
public ?string $title = null;

/**
* @param 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. More info on Sending Files »
* @param string|\Tii\Telepath\Types\InputFile $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. More info on Sending Files »
* @param \Tii\Telepath\Types\InputFile|string $thumb Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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 »
* @param string $caption Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
* @param string $parse_mode Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
Expand All @@ -37,7 +37,7 @@ class InputMediaAudio extends InputMedia
* @param string $title Optional. Title of the audio
*/
public static function make(
string $media,
string|\Tii\Telepath\Types\InputFile $media,
\Tii\Telepath\Types\InputFile|string|null $thumb = null,
?string $caption = null,
?string $parse_mode = null,
Expand Down
4 changes: 2 additions & 2 deletions src/Telegram/InputMediaDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class InputMediaDocument extends InputMedia
public ?bool $disable_content_type_detection = null;

/**
* @param 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. More info on Sending Files »
* @param string|\Tii\Telepath\Types\InputFile $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. More info on Sending Files »
* @param \Tii\Telepath\Types\InputFile|string $thumb Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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 »
* @param string $caption Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
* @param string $parse_mode Optional. Mode for parsing entities in the document caption. See formatting options for more details.
* @param MessageEntity[] $caption_entities Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
* @param bool $disable_content_type_detection Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.
*/
public static function make(
string $media,
string|\Tii\Telepath\Types\InputFile $media,
\Tii\Telepath\Types\InputFile|string|null $thumb = null,
?string $caption = null,
?string $parse_mode = null,
Expand Down
4 changes: 2 additions & 2 deletions src/Telegram/InputMediaPhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class InputMediaPhoto extends InputMedia
public string $type = 'photo';

/**
* @param 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. More info on Sending Files »
* @param string|\Tii\Telepath\Types\InputFile $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. More info on Sending Files »
* @param string $caption Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
* @param string $parse_mode Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
* @param MessageEntity[] $caption_entities Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
*/
public static function make(
string $media,
string|\Tii\Telepath\Types\InputFile $media,
?string $caption = null,
?string $parse_mode = null,
?array $caption_entities = null
Expand Down
4 changes: 2 additions & 2 deletions src/Telegram/InputMediaVideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class InputMediaVideo extends InputMedia
public ?bool $supports_streaming = null;

/**
* @param 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. More info on Sending Files »
* @param string|\Tii\Telepath\Types\InputFile $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. More info on Sending Files »
* @param \Tii\Telepath\Types\InputFile|string $thumb Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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 »
* @param string $caption Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
* @param string $parse_mode Optional. Mode for parsing entities in the video caption. See formatting options for more details.
Expand All @@ -41,7 +41,7 @@ class InputMediaVideo extends InputMedia
* @param bool $supports_streaming Optional. Pass True, if the uploaded video is suitable for streaming
*/
public static function make(
string $media,
string|\Tii\Telepath\Types\InputFile $media,
\Tii\Telepath\Types\InputFile|string|null $thumb = null,
?string $caption = null,
?string $parse_mode = null,
Expand Down
Binary file modified telepathy
Binary file not shown.

0 comments on commit e1b2042

Please sign in to comment.