1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types; |
4
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
6
|
|
|
use TelegramBot\Api\TypeInterface; |
7
|
|
|
|
8
|
|
|
class ChatPermissions extends BaseType implements TypeInterface |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* {@inheritdoc} |
12
|
|
|
* |
13
|
|
|
* @var array |
14
|
|
|
*/ |
15
|
|
|
static protected $requiredParams = []; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* {@inheritdoc} |
19
|
|
|
* |
20
|
|
|
* @var array |
21
|
|
|
*/ |
22
|
|
|
static protected $map = [ |
23
|
|
|
'can_send_messages' => true, |
24
|
|
|
'can_send_media_messages' => true, |
25
|
|
|
'can_send_polls' => true, |
26
|
|
|
'can_send_other_messages' => true, |
27
|
|
|
'can_add_web_page_previews' => true, |
28
|
|
|
'can_change_info' => true, |
29
|
|
|
'can_invite_users' => true, |
30
|
|
|
'can_pin_messages' => true, |
31
|
|
|
]; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Optional. True, if the user is allowed to send text messages, contacts, locations and venues |
35
|
|
|
* |
36
|
|
|
* @var bool |
37
|
|
|
*/ |
38
|
|
|
protected $canSendMessages; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, |
42
|
|
|
* implies can_send_messages |
43
|
|
|
* |
44
|
|
|
* @var bool |
45
|
|
|
*/ |
46
|
|
|
protected $canSendMediaMessages; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Optional. True, if the user is allowed to send polls, implies can_send_messages |
50
|
|
|
* |
51
|
|
|
* @var bool |
52
|
|
|
*/ |
53
|
|
|
protected $canSendPolls; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies |
57
|
|
|
* can_send_media_messages |
58
|
|
|
* |
59
|
|
|
* @var bool |
60
|
|
|
*/ |
61
|
|
|
protected $canSendOtherMessages; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Optional. True, if the user is allowed to add web page previews to their messages, implies |
65
|
|
|
* can_send_media_messages |
66
|
|
|
* |
67
|
|
|
* @var bool |
68
|
|
|
*/ |
69
|
|
|
protected $canAddWebPagePreviews; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public |
73
|
|
|
* supergroups |
74
|
|
|
* |
75
|
|
|
* @var bool |
76
|
|
|
*/ |
77
|
|
|
protected $canChangeInfo; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Optional. True, if the user is allowed to invite new users to the chat |
81
|
|
|
* |
82
|
|
|
* @var bool |
83
|
|
|
*/ |
84
|
|
|
protected $canInviteUsers; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Optional. True, if the user is allowed to pin messages. Ignored in public supergroups |
88
|
|
|
* |
89
|
|
|
* @var bool |
90
|
|
|
*/ |
91
|
|
|
protected $canPinMessages; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @return bool |
95
|
|
|
*/ |
96
|
|
|
public function isCanSendMessages() |
97
|
|
|
{ |
98
|
|
|
return $this->canSendMessages; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @param bool $canSendMessages |
103
|
|
|
*/ |
104
|
|
|
public function setCanSendMessages($canSendMessages) |
105
|
|
|
{ |
106
|
|
|
$this->canSendMessages = $canSendMessages; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @return bool |
111
|
|
|
*/ |
112
|
|
|
public function isCanSendMediaMessages() |
113
|
|
|
{ |
114
|
|
|
return $this->canSendMediaMessages; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @param bool $canSendMediaMessages |
119
|
|
|
*/ |
120
|
|
|
public function setCanSendMediaMessages($canSendMediaMessages) |
121
|
|
|
{ |
122
|
|
|
$this->canSendMediaMessages = $canSendMediaMessages; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @return bool |
127
|
|
|
*/ |
128
|
|
|
public function isCanSendPolls() |
129
|
|
|
{ |
130
|
|
|
return $this->canSendPolls; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @param bool $canSendPolls |
135
|
|
|
*/ |
136
|
|
|
public function setCanSendPolls($canSendPolls) |
137
|
|
|
{ |
138
|
|
|
$this->canSendPolls = $canSendPolls; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @return bool |
143
|
|
|
*/ |
144
|
|
|
public function isCanSendOtherMessages() |
145
|
|
|
{ |
146
|
|
|
return $this->canSendOtherMessages; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* @param bool $canSendOtherMessages |
151
|
|
|
*/ |
152
|
|
|
public function setCanSendOtherMessages($canSendOtherMessages) |
153
|
|
|
{ |
154
|
|
|
$this->canSendOtherMessages = $canSendOtherMessages; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* @return bool |
159
|
|
|
*/ |
160
|
|
|
public function isCanAddWebPagePreviews() |
161
|
|
|
{ |
162
|
|
|
return $this->canAddWebPagePreviews; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* @param bool $canAddWebPagePreviews |
167
|
|
|
*/ |
168
|
|
|
public function setCanAddWebPagePreviews($canAddWebPagePreviews) |
169
|
|
|
{ |
170
|
|
|
$this->canAddWebPagePreviews = $canAddWebPagePreviews; |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* @return bool |
175
|
|
|
*/ |
176
|
|
|
public function isCanChangeInfo() |
177
|
|
|
{ |
178
|
|
|
return $this->canChangeInfo; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* @param bool $canChangeInfo |
183
|
|
|
*/ |
184
|
|
|
public function setCanChangeInfo($canChangeInfo) |
185
|
|
|
{ |
186
|
|
|
$this->canChangeInfo = $canChangeInfo; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* @return bool |
191
|
|
|
*/ |
192
|
|
|
public function isCanInviteUsers() |
193
|
|
|
{ |
194
|
|
|
return $this->canInviteUsers; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* @param bool $canInviteUsers |
199
|
|
|
*/ |
200
|
|
|
public function setCanInviteUsers($canInviteUsers) |
201
|
|
|
{ |
202
|
|
|
$this->canInviteUsers = $canInviteUsers; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* @return bool |
207
|
|
|
*/ |
208
|
|
|
public function isCanPinMessages() |
209
|
|
|
{ |
210
|
|
|
return $this->canPinMessages; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* @param bool $canPinMessages |
215
|
|
|
*/ |
216
|
|
|
public function setCanPinMessages($canPinMessages) |
217
|
|
|
{ |
218
|
|
|
$this->canPinMessages = $canPinMessages; |
219
|
|
|
} |
220
|
|
|
} |
221
|
|
|
|