-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathSendDocument.php
More file actions
82 lines (66 loc) · 1.75 KB
/
Copy pathSendDocument.php
File metadata and controls
82 lines (66 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
namespace Formapro\TelegramBot;
use function Formapro\Values\get_value;
use function Formapro\Values\get_values;
use function Formapro\Values\set_object;
use function Formapro\Values\set_value;
class SendDocument
{
private $values = [];
/**
* @var FileId|FileUrl|InputFile
*/
private $document;
/**
* @param int $chatId
* @param FileId|FileUrl|InputFile $document
*/
private function __construct(int $chatId, $document)
{
set_value($this, 'chat_id', $chatId);
$this->document = $document;
}
public function getChatId(): int
{
return get_value($this, 'chat_id');
}
/**
* @return FileId|FileUrl|InputFile
*/
public function getDocument()
{
return $this->document;
}
public function getCaption(): string
{
return get_value($this, 'caption');
}
public function setCaption(string $caption): void
{
set_value($this, 'caption', $caption);
}
public function setParseMode(string $parseMode): void
{
set_value($this, 'parse_mode', $parseMode);
}
public function getParseMode(): ?string
{
return get_value($this, 'parse_mode');
}
public function setReplyMarkup(ReplyMarkup $replyMarkup): void
{
set_value($this, 'reply_markup', json_encode(get_values($replyMarkup)));
}
public static function withInputFile(int $chatId, InputFile $file): self
{
return new static($chatId, $file);
}
public static function withFileUrl(int $chatId, FileUrl $file): self
{
return new static($chatId, $file);
}
public static function withFileId(int $chatId, FileId $file): self
{
return new static($chatId, $file);
}
}