1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types = 1); |
4
|
|
|
|
5
|
|
|
namespace unreal4u\TelegramAPI\Telegram\Methods; |
6
|
|
|
|
7
|
|
|
use unreal4u\TelegramAPI\Abstracts\KeyboardMethods; |
8
|
|
|
use unreal4u\TelegramAPI\Abstracts\TelegramMethods; |
9
|
|
|
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any |
13
|
|
|
* type of up to 50 MB in size, this limit may be changed in the future. |
14
|
|
|
* |
15
|
|
|
* Objects defined as-is January 2017 |
16
|
|
|
* |
17
|
|
|
* @see https://core.telegram.org/bots/api#senddocument |
18
|
|
|
*/ |
19
|
|
|
class SendDocument extends TelegramMethods |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
23
|
|
|
* @var string |
24
|
|
|
*/ |
25
|
|
|
public $chat_id = ''; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an |
29
|
|
|
* HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using the InputFile class |
30
|
|
|
* |
31
|
|
|
* @see InputFile |
32
|
|
|
* @var string|InputFile |
33
|
|
|
*/ |
34
|
|
|
public $document = ''; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Optional. Document caption (may also be used when resending documents by file_id), 0-200 characters |
38
|
|
|
* @var string |
39
|
|
|
*/ |
40
|
|
|
public $caption = ''; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Optional. Sends the message silently. iOS users will not receive a notification, Android users will receive a |
44
|
|
|
* notification with no sound. |
45
|
|
|
* @see https://telegram.org/blog/channels-2-0#silent-messages |
46
|
|
|
* @var bool |
47
|
|
|
*/ |
48
|
|
|
public $disable_notification = false; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Optional. If the message is a reply, ID of the original message |
52
|
|
|
* @var int |
53
|
|
|
*/ |
54
|
|
|
public $reply_to_message_id = 0; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to |
58
|
|
|
* hide keyboard or to force a reply from the user |
59
|
|
|
* @var KeyboardMethods |
60
|
|
|
*/ |
61
|
|
|
public $reply_markup; |
62
|
|
|
|
63
|
1 |
|
public function getMandatoryFields(): array |
64
|
|
|
{ |
65
|
|
|
return [ |
66
|
1 |
|
'chat_id', |
67
|
|
|
'document', |
68
|
|
|
]; |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|