@@ -31,23 +31,23 @@ discard block |
||
31 | 31 | public int $duration; |
32 | 32 | |
33 | 33 | /** Optional. Video thumbnail */ |
34 | - public null|photoSize $thumb = null; |
|
34 | + public null | photoSize $thumb = null; |
|
35 | 35 | |
36 | 36 | /** Optional. Original filename as defined by sender */ |
37 | - public null|string $file_name = null; |
|
37 | + public null | string $file_name = null; |
|
38 | 38 | |
39 | 39 | /** Optional. MIME type of the file as defined by sender */ |
40 | - public null|string $mime_type = null; |
|
40 | + public null | string $mime_type = null; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
44 | 44 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
45 | 45 | * integer or double-precision float type are safe for storing this value. |
46 | 46 | */ |
47 | - public null|int $file_size = null; |
|
47 | + public null | int $file_size = null; |
|
48 | 48 | |
49 | 49 | |
50 | - public function __construct(stdClass|null $object = null) { |
|
50 | + public function __construct(stdClass | null $object = null) { |
|
51 | 51 | if ($object != null) { |
52 | 52 | parent::__construct($object, self::subs); |
53 | 53 | } |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return bool|string string will be returned when destination doesn't set |
70 | 70 | */ |
71 | - public function download(string|null $destination = null): bool|string { |
|
72 | - return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp4',$this->file_id); |
|
71 | + public function download(string | null $destination = null): bool | string { |
|
72 | + return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp4', $this->file_id); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | public function link(): string { |
@@ -38,34 +38,34 @@ discard block |
||
38 | 38 | public int $height; |
39 | 39 | |
40 | 40 | /** True, if the sticker is animated */ |
41 | - public null|bool $is_animated = null; |
|
41 | + public null | bool $is_animated = null; |
|
42 | 42 | |
43 | 43 | /** True, if the sticker is a video sticker */ |
44 | - public null|bool $is_video = null; |
|
44 | + public null | bool $is_video = null; |
|
45 | 45 | |
46 | 46 | /** Optional. Sticker thumbnail in the .WEBP or .JPG format */ |
47 | - public null|photoSize $thumb = null; |
|
47 | + public null | photoSize $thumb = null; |
|
48 | 48 | |
49 | 49 | /** Optional. Emoji associated with the sticker */ |
50 | - public null|string $emoji = null; |
|
50 | + public null | string $emoji = null; |
|
51 | 51 | |
52 | 52 | /** Optional. Name of the sticker set to which the sticker belongs */ |
53 | - public null|string $set_name = null; |
|
53 | + public null | string $set_name = null; |
|
54 | 54 | |
55 | 55 | /** Optional. Premium animation for the sticker, if the sticker is premium */ |
56 | - public null|file $premium_animation = null; |
|
56 | + public null | file $premium_animation = null; |
|
57 | 57 | |
58 | 58 | /** Optional. For mask stickers, the position where the mask should be placed */ |
59 | - public null|maskPosition $mask_position = null; |
|
59 | + public null | maskPosition $mask_position = null; |
|
60 | 60 | |
61 | 61 | /** Optional. For custom emoji stickers, unique identifier of the custom emoji */ |
62 | - public null|string $custom_emoji_id = null; |
|
62 | + public null | string $custom_emoji_id = null; |
|
63 | 63 | |
64 | 64 | /** Optional. File size in bytes */ |
65 | - public null|int $file_size = null; |
|
65 | + public null | int $file_size = null; |
|
66 | 66 | |
67 | 67 | |
68 | - public function __construct(stdClass|null $object = null) { |
|
68 | + public function __construct(stdClass | null $object = null) { |
|
69 | 69 | if ($object != null) { |
70 | 70 | parent::__construct($object, self::subs); |
71 | 71 | } |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return bool|string string will be returned when destination doesn't set |
88 | 88 | */ |
89 | - public function download(string|null $destination = null): bool|string { |
|
90 | - return telegram::downloadFile($destination ?? 'unknown.png',$this->file_id); |
|
89 | + public function download(string | null $destination = null): bool | string { |
|
90 | + return telegram::downloadFile($destination ?? 'unknown.png', $this->file_id); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | public function link(): string { |
@@ -31,23 +31,23 @@ discard block |
||
31 | 31 | public int $duration; |
32 | 32 | |
33 | 33 | /** Optional. Animation thumbnail as defined by sender */ |
34 | - public null|photoSize $thumb = null; |
|
34 | + public null | photoSize $thumb = null; |
|
35 | 35 | |
36 | 36 | /** Optional. Original animation filename as defined by sender */ |
37 | - public null|string $file_name = null; |
|
37 | + public null | string $file_name = null; |
|
38 | 38 | |
39 | 39 | /** Optional. MIME type of the file as defined by sender */ |
40 | - public null|string $mime_type = null; |
|
40 | + public null | string $mime_type = null; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
44 | 44 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
45 | 45 | * integer or double-precision float type are safe for storing this value. |
46 | 46 | */ |
47 | - public null|int $file_size = null; |
|
47 | + public null | int $file_size = null; |
|
48 | 48 | |
49 | 49 | |
50 | - public function __construct(stdClass|null $object = null) { |
|
50 | + public function __construct(stdClass | null $object = null) { |
|
51 | 51 | if ($object != null) { |
52 | 52 | parent::__construct($object, self::subs); |
53 | 53 | } |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return bool|string string will be returned when destination doesn't set |
70 | 70 | */ |
71 | - public function download(string|null $destination = null): bool|string { |
|
72 | - return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.gif',$this->file_id); |
|
71 | + public function download(string | null $destination = null): bool | string { |
|
72 | + return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.gif', $this->file_id); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | public function link(): string { |
@@ -31,19 +31,19 @@ |
||
31 | 31 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
32 | 32 | * integer or double-precision float type are safe for storing this value. |
33 | 33 | */ |
34 | - public null|int $file_size = null; |
|
34 | + public null | int $file_size = null; |
|
35 | 35 | |
36 | 36 | /** Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */ |
37 | - public null|string $file_path = null; |
|
37 | + public null | string $file_path = null; |
|
38 | 38 | |
39 | 39 | |
40 | - public function __construct(stdClass|null $object = null) { |
|
40 | + public function __construct(stdClass | null $object = null) { |
|
41 | 41 | if ($object != null) { |
42 | 42 | parent::__construct($object, self::subs); |
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | 46 | public function link(): string { |
47 | - return settings::$down_url . 'bot' . settings::$token . '/' . $this->file_path; |
|
47 | + return settings::$down_url.'bot'.settings::$token.'/'.$this->file_path; |
|
48 | 48 | } |
49 | 49 | } |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | public int $duration; |
26 | 26 | |
27 | 27 | /** Optional. MIME type of the file as defined by sender */ |
28 | - public null|string $mime_type = null; |
|
28 | + public null | string $mime_type = null; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
32 | 32 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
33 | 33 | * integer or double-precision float type are safe for storing this value. |
34 | 34 | */ |
35 | - public null|int $file_size = null; |
|
35 | + public null | int $file_size = null; |
|
36 | 36 | |
37 | 37 | |
38 | - public function __construct(stdClass|null $object = null) { |
|
38 | + public function __construct(stdClass | null $object = null) { |
|
39 | 39 | if ($object != null) { |
40 | 40 | parent::__construct($object, self::subs); |
41 | 41 | } |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return bool|string string will be returned when destination doesn't set |
58 | 58 | */ |
59 | - public function download(string|null $destination = null): bool|string { |
|
60 | - return telegram::downloadFile($destination ?? 'unknown.ogg',$this->file_id); |
|
59 | + public function download(string | null $destination = null): bool | string { |
|
60 | + return telegram::downloadFile($destination ?? 'unknown.ogg', $this->file_id); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function link(): string { |
@@ -25,47 +25,47 @@ |
||
25 | 25 | * Optional. Message with the callback button that originated the query. Note that message content and message |
26 | 26 | * date will not be available if the message is too old |
27 | 27 | */ |
28 | - public null|message $message = null; |
|
28 | + public null | message $message = null; |
|
29 | 29 | |
30 | 30 | /** Optional. Identifier of the message sent via the bot in inline mode, that originated the query. */ |
31 | - public null|string $inline_message_id = null; |
|
31 | + public null | string $inline_message_id = null; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. |
35 | 35 | * Useful for high scores in games. |
36 | 36 | */ |
37 | - public null|string $chat_instance = null; |
|
37 | + public null | string $chat_instance = null; |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Optional. Data associated with the callback button. Be aware that the message originated the query can contain |
41 | 41 | * no callback buttons with this data. |
42 | 42 | */ |
43 | - public null|string $data = null; |
|
43 | + public null | string $data = null; |
|
44 | 44 | |
45 | 45 | /** Optional. Short name of a Game to be returned, serves as the unique identifier for the game */ |
46 | - public null|string $game_short_name = null; |
|
46 | + public null | string $game_short_name = null; |
|
47 | 47 | |
48 | 48 | |
49 | - public function __construct(stdClass|null $object = null) { |
|
49 | + public function __construct(stdClass | null $object = null) { |
|
50 | 50 | if ($object != null) { |
51 | 51 | parent::__construct($object, self::subs); |
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | - public function editText (string $text): message|responseError|bool { |
|
56 | + public function editText(string $text): message | responseError | bool { |
|
57 | 57 | return telegram::editMessageText($text); |
58 | 58 | } |
59 | 59 | |
60 | - public function editCaption (string $text = ''): message|responseError|bool { |
|
60 | + public function editCaption(string $text = ''): message | responseError | bool { |
|
61 | 61 | return telegram::editMessageCaption(caption: $text); |
62 | 62 | } |
63 | 63 | |
64 | - public function editKeyboard (inlineKeyboardMarkup|stdClass|array $reply_markup = null): message|responseError|bool { |
|
64 | + public function editKeyboard(inlineKeyboardMarkup | stdClass | array $reply_markup = null): message | responseError | bool { |
|
65 | 65 | return telegram::editMessageReplyMarkup(reply_markup: $reply_markup); |
66 | 66 | } |
67 | 67 | |
68 | - public function editMedia (inputMedia|array|stdClass $media): message|responseError|bool { |
|
68 | + public function editMedia(inputMedia | array | stdClass $media): message | responseError | bool { |
|
69 | 69 | return telegram::editMessageMedia($media); |
70 | 70 | } |
71 | 71 | } |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | public int $duration; |
29 | 29 | |
30 | 30 | /** Optional. Video thumbnail */ |
31 | - public null|photoSize $thumb = null; |
|
31 | + public null | photoSize $thumb = null; |
|
32 | 32 | |
33 | 33 | /** Optional. File size in bytes */ |
34 | - public null|int $file_size = null; |
|
34 | + public null | int $file_size = null; |
|
35 | 35 | |
36 | 36 | |
37 | - public function __construct(stdClass|null $object = null) { |
|
37 | + public function __construct(stdClass | null $object = null) { |
|
38 | 38 | if ($object != null) { |
39 | 39 | parent::__construct($object, self::subs); |
40 | 40 | } |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return bool|string string will be returned when destination doesn't set |
57 | 57 | */ |
58 | - public function download(string|null $destination = null): bool|string { |
|
59 | - return telegram::downloadFile($destination ?? 'unknown.mp4',$this->file_id); |
|
58 | + public function download(string | null $destination = null): bool | string { |
|
59 | + return telegram::downloadFile($destination ?? 'unknown.mp4', $this->file_id); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | public function link(): string { |
@@ -22,23 +22,23 @@ discard block |
||
22 | 22 | public string $file_unique_id; |
23 | 23 | |
24 | 24 | /** Optional. Document thumbnail as defined by sender */ |
25 | - public null|photoSize $thumb = null; |
|
25 | + public null | photoSize $thumb = null; |
|
26 | 26 | |
27 | 27 | /** Optional. Original filename as defined by sender */ |
28 | - public null|string $file_name = null; |
|
28 | + public null | string $file_name = null; |
|
29 | 29 | |
30 | 30 | /** Optional. MIME type of the file as defined by sender */ |
31 | - public null|string $mime_type = null; |
|
31 | + public null | string $mime_type = null; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
35 | 35 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
36 | 36 | * integer or double-precision float type are safe for storing this value. |
37 | 37 | */ |
38 | - public null|int $file_size = null; |
|
38 | + public null | int $file_size = null; |
|
39 | 39 | |
40 | 40 | |
41 | - public function __construct(stdClass|null $object = null) { |
|
41 | + public function __construct(stdClass | null $object = null) { |
|
42 | 42 | if ($object != null) { |
43 | 43 | parent::__construct($object, self::subs); |
44 | 44 | } |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @return bool|string string will be returned when destination doesn't set |
61 | 61 | */ |
62 | - public function download(string|null $destination = null): bool|string { |
|
63 | - return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.txt',$this->file_id); |
|
62 | + public function download(string | null $destination = null): bool | string { |
|
63 | + return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.txt', $this->file_id); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function link(): string { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * telegram class , Adding normal method call to request class and a simple name for being easy to call |
16 | 16 | */ |
17 | 17 | class telegram extends request { |
18 | - public function __call (string $name, array $arguments) { |
|
18 | + public function __call(string $name, array $arguments) { |
|
19 | 19 | return request::$name(...$arguments); |
20 | 20 | } |
21 | 21 | |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @return bool |
35 | 35 | */ |
36 | - public static function downloadFile (string|null $destination = null, string|null $file_id = null): bool { |
|
36 | + public static function downloadFile(string | null $destination = null, string | null $file_id = null): bool { |
|
37 | 37 | return tools::downloadFile(self::fileLink($file_id), $destination); |
38 | 38 | } |
39 | 39 | |
40 | - public static function fileLink(string|null $file_id = null): bool|string { |
|
40 | + public static function fileLink(string | null $file_id = null): bool | string { |
|
41 | 41 | $file = self::getFile($file_id); |
42 | 42 | if (!isset($file->file_path)) { |
43 | 43 | return false; |
@@ -59,31 +59,31 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @return message|bool|responseError |
61 | 61 | */ |
62 | - public static function sendFile (string $file_id, int|string $chat_id = null, int $message_thread_id = null, string $caption = null, string $parse_mode = null, array $caption_entities = null, bool $disable_notification = null, bool $protect_content = null, int $reply_to_message_id = null, bool $allow_sending_without_reply = null, inlineKeyboardMarkup|replyKeyboardMarkup|replyKeyboardRemove|forceReply|stdClass|array $reply_markup = null, string $token = null, bool $forgot = null, bool $answer = null): message|bool|responseError { |
|
62 | + public static function sendFile(string $file_id, int | string $chat_id = null, int $message_thread_id = null, string $caption = null, string $parse_mode = null, array $caption_entities = null, bool $disable_notification = null, bool $protect_content = null, int $reply_to_message_id = null, bool $allow_sending_without_reply = null, inlineKeyboardMarkup | replyKeyboardMarkup | replyKeyboardRemove | forceReply | stdClass | array $reply_markup = null, string $token = null, bool $forgot = null, bool $answer = null): message | bool | responseError { |
|
63 | 63 | $type = tools::fileType($file_id); |
64 | 64 | if ($type === fileTypes::VIDEO) { |
65 | - return self::sendVideo($file_id,$chat_id,$message_thread_id,null,null,null,null,$caption,$parse_mode,$caption_entities,null,$disable_notification,$protect_content,$reply_to_message_id,$allow_sending_without_reply,$reply_markup,$token,$forgot,$answer); |
|
65 | + return self::sendVideo($file_id, $chat_id, $message_thread_id, null, null, null, null, $caption, $parse_mode, $caption_entities, null, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer); |
|
66 | 66 | } |
67 | 67 | elseif ($type === fileTypes::VIDEO_NOTE) { |
68 | - return self::sendVideoNote($file_id,$chat_id,$message_thread_id,null,null,null,$disable_notification,$protect_content,$reply_to_message_id,$allow_sending_without_reply,$reply_markup,$token,$forgot,$answer); |
|
68 | + return self::sendVideoNote($file_id, $chat_id, $message_thread_id, null, null, null, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer); |
|
69 | 69 | } |
70 | 70 | elseif ($type === fileTypes::ANIMATION) { |
71 | - return self::sendAnimation($file_id,$chat_id,$message_thread_id,null,null,null,null,$caption,$parse_mode,$caption_entities,$disable_notification,$protect_content,$reply_to_message_id,$allow_sending_without_reply,$reply_markup,$token,$forgot,$answer); |
|
71 | + return self::sendAnimation($file_id, $chat_id, $message_thread_id, null, null, null, null, $caption, $parse_mode, $caption_entities, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer); |
|
72 | 72 | } |
73 | 73 | elseif ($type === fileTypes::AUDIO) { |
74 | - return self::sendAudio($file_id,$chat_id,$message_thread_id,$caption,$parse_mode,$caption_entities,null,null,null,null,$disable_notification,$protect_content,$reply_to_message_id,$allow_sending_without_reply,$reply_markup,$token,$forgot,$answer); |
|
74 | + return self::sendAudio($file_id, $chat_id, $message_thread_id, $caption, $parse_mode, $caption_entities, null, null, null, null, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer); |
|
75 | 75 | } |
76 | 76 | elseif ($type === fileTypes::PHOTO || $type === fileTypes::PROFILE_PHOTO) { |
77 | - return self::sendPhoto($file_id,$chat_id,$message_thread_id,$caption,$parse_mode,$caption_entities,$disable_notification,$protect_content,$reply_to_message_id,$allow_sending_without_reply,$reply_markup,$token,$forgot,$answer); |
|
77 | + return self::sendPhoto($file_id, $chat_id, $message_thread_id, $caption, $parse_mode, $caption_entities, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer); |
|
78 | 78 | } |
79 | 79 | elseif ($type === fileTypes::VOICE) { |
80 | - return self::sendVoice($file_id,$chat_id,$message_thread_id,$caption,$parse_mode,$caption_entities,null,$disable_notification,$protect_content,$reply_to_message_id,$allow_sending_without_reply,$reply_markup,$token,$forgot,$answer); |
|
80 | + return self::sendVoice($file_id, $chat_id, $message_thread_id, $caption, $parse_mode, $caption_entities, null, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer); |
|
81 | 81 | } |
82 | 82 | elseif ($type === fileTypes::STICKER) { |
83 | - return self::sendSticker($file_id,$chat_id,$message_thread_id,$disable_notification,$protect_content,$reply_to_message_id,$allow_sending_without_reply,$reply_markup,$token,$forgot,$answer); |
|
83 | + return self::sendSticker($file_id, $chat_id, $message_thread_id, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer); |
|
84 | 84 | } |
85 | 85 | elseif ($type === fileTypes::DOCUMENT) { |
86 | - return self::sendDocument($file_id,$chat_id,$message_thread_id,null,$caption,$parse_mode,$caption_entities,null,$disable_notification,$protect_content,$reply_to_message_id,$allow_sending_without_reply,$reply_markup,$token,$forgot,$answer); |
|
86 | + return self::sendDocument($file_id, $chat_id, $message_thread_id, null, $caption, $parse_mode, $caption_entities, null, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer); |
|
87 | 87 | } |
88 | 88 | else return false; |
89 | 89 | } |