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