├── banlist.txt
├── pmembers.txt
├── booleans.txt
├── msgs.txt
├── README.md
└── Luncher.php
/banlist.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pmembers.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/booleans.txt:
--------------------------------------------------------------------------------
1 | false
2 |
--------------------------------------------------------------------------------
/msgs.txt:
--------------------------------------------------------------------------------
1 | سلام
2 | پيام خود را ارسال کنيد.
3 | -!-@-#-$
4 | پيام ارسال شد
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # install PvResan
2 |
3 |
4 | [join to @OpenID](https://telegram.me/openid)
5 |
6 | [creator](https://telegram.me/mutepuker)
7 |
8 |
9 | Source PvResan
10 |
11 | very very Tnx @nawr_i_man ❤👑
12 |
13 | اين آموزش پولي ميباشد اما ما بصورت رايگان براي شما قرار داده ايم , براي حمايت به ما ستاره بديد و در كانال ما جوين بشيد
14 |
15 | #installbot
16 | ```sh
17 | ابتدا در سايت
18 |
19 | github.com
20 |
21 | ثبت نام كنيد !
22 |
23 | و وارد جيميل خود شده و اكانت خود را تاييد كنيد.
24 |
25 | سپس گزينه + را انتخاب كرده و
26 |
27 | new repository
28 |
29 | را انتخاب كرده , هم اكنون وارد صفحه جديد شديد
30 |
31 | در قسمت
32 |
33 | repository name
34 |
35 | يك نام براي پروژه خود انتخاب كنيد !
36 |
37 | و سپس دستور
38 |
39 | create repository
40 |
41 | را انتخاب كنيد
42 |
43 | سپس صفحه جديدي باز ميشود به ان كاري ندارم و گزينه
44 |
45 | Import
46 |
47 | را انتخاب ميكنيم
48 |
49 | در صفحه جديد در جاي خالي گزينه
50 |
51 | your old repository's clone URL
52 |
53 | لينك گيتهاب ما يعني
54 |
55 | https://github.com/MutePuker/PvResan.git
56 |
57 | را جاي گذاري كرده و گزينه
58 |
59 | bgin imkport
60 |
61 | را انتخاب ميكنيم !
62 |
63 | ميبينيد كه كد ها در
64 |
65 | repository
66 |
67 | شما قرار گرفتند
68 |
69 | روي فايل
70 |
71 | Luncher.php
72 |
73 | كليك كنيد
74 |
75 | و گزينه ويرايش را بزديد
76 | (به شكل مداد ميباشد)
77 |
78 | حالا در لاين 2 اين فايل شما
79 |
80 | **TOKAN*
81 |
82 | را پاك كرده و توكن ربات خود را قرار دهيد !
83 |
84 | و در لاين 118
85 |
86 | **ADMIN**
87 |
88 | را پاك كرده و ايدي عددي يا همان شناسه خود را بگذاريد !
89 |
90 | ميتوانيد ايدي خود را از @MYIDbot
91 |
92 | دريافت كنيد
93 | ```
94 | خب كار ما با گيت هاب تمام شده و بايد بات را روي سرور قرار دهيم
95 |
96 | ```sh
97 | براي قرار گرفتن ربات بر روي سرور ابتدا در
98 |
99 | openshift.com
100 |
101 | عضو شده و لينك خود را در جيميل تاييد كنيد
102 |
103 | پس از تاييد با صفحه جديدي مواجع ميشويد كه بايد گزينه 4 يعني
104 |
105 | create your first application now
106 |
107 | را انتخاب كنيد
108 |
109 | در صفحه جديد فهرست
110 | PHP
111 | را پيدا كنيد و گزينه
112 | PHP 5.4
113 | را انتخاب كنيد !
114 |
115 | در صفحه بعد شما بايد 2 نام براي خودتون انتخاب بكنيد
116 |
117 |
118 | و در قسمت
119 | Source Code
120 | ادرس گيت خود را وارد كنيد !
121 |
122 | توجه داشتنه باشيد حتما بايد در اخر ان
123 | .git
124 | بگذاريد
125 |
126 | يعني اگر ادرس شما
127 | https://github.com/MutePuker/PvResan
128 | بود بايد شما به اين صورت واد كنيد
129 | https://github.com/MutePuker/PvResan.git
130 |
131 | كار ما تمام شد به چيزي كار نداريم و
132 | Create Application
133 | را ميزنيم!
134 |
135 | و حالا كافيه وبهوك رباتتون رو با اين آدرس ست كنيد
136 | مثال
137 | https://Pvresan-Pvresan.rhcloud.com/Luncher.php
138 | و به جاي
139 | PVresan
140 | نامي كه انتخاب كرديد بزنيد
141 |
142 | در اخر شما يك صفحه جديد باز كنيد و ادرس
143 |
144 | https://api.telegram.org/bot/setwebhook?url=https://Pvresan-pvresan.rhcloud.com/Luncher.php
145 |
146 | را وارد كنيد
147 |
148 | - توجه داشته باشيد در قسمت
149 | - Pvresan-Pvrsan
150 | -را به نامي كه انتخاب كرديد تغيير دهيد!
151 | -------------------------------------------
152 | در قسمت
153 |
154 | توكن ربات خود را قرار دهيد
155 | توجه داشته باشيد <> هم پاك كنيد !
156 | اگر تمام مراحل را درست رفته باشيد بعد از پشت سر گذاشتن مرحله اخر و بارگذاري اخر دستوري به اين صورت
157 | {"ok":true,"result":true,"description":"Webhook was set"}
158 | بالا مياد كه نشان ميده ربات انلاين شده و ميتونيد استفاده كنيد !
159 | --------------------------------------------
160 | دستورات ربات
161 |
162 | # Commands
163 | >[/]setstart
164 | >> ست كردن متن استارت
165 | ---------------------------
166 | >/setdone
167 | >>ست كردن متن پاسخگويي
168 | ---------------------------
169 | >[/]ban
170 | >> بن كردن كاربر
171 | --------------------------
172 | >/unban
173 | >> ان بن كردن كاربر
174 |
--------------------------------------------------------------------------------
/Luncher.php:
--------------------------------------------------------------------------------
1 | = 500) {
40 | // do not wat to DDOS server if something goes wrong
41 | sleep(10);
42 | return false;
43 | } else if ($http_code != 200) {
44 | $response = json_decode($response, true);
45 | error_log("Request has failed with error {$response['error_code']}: {$response['description']}\n");
46 | if ($http_code == 401) {
47 | throw new Exception('Invalid access token provided');
48 | }
49 | return false;
50 | } else {
51 | $response = json_decode($response, true);
52 | if (isset($response['description'])) {
53 | error_log("Request was successfull: {$response['description']}\n");
54 | }
55 | $response = $response['result'];
56 | }
57 |
58 | return $response;
59 | }
60 |
61 | function apiRequest($method, $parameters) {
62 | if (!is_string($method)) {
63 | error_log("Method name must be a string\n");
64 | return false;
65 | }
66 |
67 | if (!$parameters) {
68 | $parameters = array();
69 | } else if (!is_array($parameters)) {
70 | error_log("Parameters must be an array\n");
71 | return false;
72 | }
73 |
74 | foreach ($parameters as $key => &$val) {
75 | // encoding to JSON array parameters, for example reply_markup
76 | if (!is_numeric($val) && !is_string($val)) {
77 | $val = json_encode($val);
78 | }
79 | }
80 | $url = API_URL.$method.'?'.http_build_query($parameters);
81 |
82 | $handle = curl_init($url);
83 | curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
84 | curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);
85 | curl_setopt($handle, CURLOPT_TIMEOUT, 60);
86 |
87 | return exec_curl_request($handle);
88 | }
89 |
90 | function apiRequestJson($method, $parameters) {
91 | if (!is_string($method)) {
92 | error_log("Method name must be a string\n");
93 | return false;
94 | }
95 |
96 | if (!$parameters) {
97 | $parameters = array();
98 | } else if (!is_array($parameters)) {
99 | error_log("Parameters must be an array\n");
100 | return false;
101 | }
102 |
103 | $parameters["method"] = $method;
104 |
105 | $handle = curl_init(API_URL);
106 | curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
107 | curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);
108 | curl_setopt($handle, CURLOPT_TIMEOUT, 60);
109 | curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($parameters));
110 | curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
111 |
112 | return exec_curl_request($handle);
113 | }
114 | function processMessage($message) {
115 | // process incoming message
116 | $boolean = file_get_contents('booleans.txt');
117 | $booleans= explode("\n",$boolean);
118 | $admin = **ADMIN**;
119 | $message_id = $message['message_id'];
120 | $rpto = $message['reply_to_message']['forward_from']['id'];
121 | $chat_id = $message['chat']['id'];
122 | $txxxtt = file_get_contents('msgs.txt');
123 | $pmembersiddd= explode("-!-@-#-$",$txxxtt);
124 | if (isset($message['photo'])) {
125 |
126 | if ( $chat_id != $admin) {
127 |
128 | $txt = file_get_contents('banlist.txt');
129 | $membersid= explode("\n",$txt);
130 |
131 | $substr = substr($text, 0, 28);
132 | if (!in_array($chat_id,$membersid)) {
133 | apiRequest("forwardMessage", array('chat_id' => $admin, "from_chat_id"=> $chat_id ,"message_id" => $message_id));
134 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $pmembersiddd[1] ,"parse_mode" =>"HTML"));
135 | }else{
136 |
137 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "You Are Banned🚫
138 | Get Out Of Here Idiot🖕
139 | --------------------------------
140 | شما در لیست سیاه قرار دارید 🚫
141 | لطفا پیام ندهید🖕" ,"parse_mode" =>"HTML"));
142 |
143 | }
144 | }
145 | else if($rpto !="" && $chat_id==$admin){
146 | $photo = $message['photo'];
147 | $photoid = json_encode($photo, JSON_PRETTY_PRINT);
148 | $photoidd = json_encode($photoid, JSON_PRETTY_PRINT);
149 | $photoidd = str_replace('"[\n {\n \"file_id\": \"','',$photoidd);
150 | $pos = strpos($photoidd, '",\n');
151 | //$pphoto = strrpos($photoid,'",\n \"file_size\": ',1);
152 | $pos = $pos -1;
153 | $substtr = substr($photoidd, 0, $pos);
154 | $caption = $message['caption'];
155 | if($caption != "")
156 | {
157 | apiRequest("sendphoto", array('chat_id' => $rpto, "photo" => $substtr,"caption" =>$caption));
158 | }
159 | else{
160 | apiRequest("sendphoto", array('chat_id' => $rpto, "photo" => $substtr));
161 | }
162 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "🗣پیام شما ارسال شد. " ,"parse_mode" =>"HTML"));
163 |
164 | } else if ($chat_id == $admin && $booleans[0] == "true") {
165 |
166 | $photo = $message['photo'];
167 | $photoid = json_encode($photo, JSON_PRETTY_PRINT);
168 | $photoidd = json_encode($photoid, JSON_PRETTY_PRINT);
169 | $photoidd = str_replace('"[\n {\n \"file_id\": \"','',$photoidd);
170 | $pos = strpos($photoidd, '",\n');
171 | //$pphoto = strrpos($photoid,'",\n \"file_size\": ',1);
172 | $pos = $pos -1;
173 | $substtr = substr($photoidd, 0, $pos);
174 | $caption = $message['caption'];
175 |
176 |
177 | $ttxtt = file_get_contents('pmembers.txt');
178 | $membersidd= explode("\n",$ttxtt);
179 | for($y=0;$y $membersidd[$y], "photo" => $substtr,"caption" =>$caption));
183 | }
184 | else{
185 | apiRequest("sendphoto", array('chat_id' => $membersidd[$y], "photo" => $substtr));
186 | }
187 |
188 | }
189 | $memcout = count($membersidd)-1;
190 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام شما به ".$memcout." مخاطب ازسال شد.
191 | .","parse_mode" =>"HTML",'reply_markup' => array(
192 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
193 | 'one_time_keyboard' => true,
194 | 'selective' => true,
195 | 'resize_keyboard' => true)));
196 | $addd = "false";
197 | file_put_contents('booleans.txt',$addd);
198 | }
199 | }
200 | if (isset($message['video'])) {
201 |
202 | if ( $chat_id != $admin) {
203 |
204 | $txt = file_get_contents('banlist.txt');
205 | $membersid= explode("\n",$txt);
206 |
207 | $substr = substr($text, 0, 28);
208 | if (!in_array($chat_id,$membersid)) {
209 | apiRequest("forwardMessage", array('chat_id' => $admin, "from_chat_id"=> $chat_id ,"message_id" => $message_id));
210 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $pmembersiddd[1],"parse_mode" =>"HTML"));
211 | }else{
212 |
213 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "You Are Banned🚫
214 | Get Out Of Here Idiot🖕
215 | --------------------------------
216 | شما در لیست سیاه قرار دارید 🚫
217 | لطفا پیام ندهید🖕" ,"parse_mode" =>"HTML"));
218 |
219 | }
220 | }
221 | else if($rpto !="" && $chat_id==$admin){
222 | $video = $message['video']['file_id'];
223 | $caption = $message['caption'];
224 | //apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $video ,"parse_mode" =>"HTML"));
225 | if($caption != "")
226 | {
227 | apiRequest("sendvideo", array('chat_id' => $rpto, "video" => $video,"caption" =>$caption));
228 | }
229 | else{
230 | apiRequest("sendvideo", array('chat_id' => $rpto, "video" => $video));
231 | }
232 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" =>"🗣پیام شما ارسال شد. ","parse_mode" =>"HTML"));
233 |
234 | }
235 | else if ($chat_id == $admin && $booleans[0] == "true") {
236 | $video = $message['video']['file_id'];
237 | $caption = $message['caption'];
238 | $ttxtt = file_get_contents('pmembers.txt');
239 | $membersidd= explode("\n",$ttxtt);
240 | for($y=0;$y $membersidd[$y], "video" => $video,"caption" =>$caption));
244 | }
245 | else{
246 | apiRequest("sendvideo", array('chat_id' => $membersidd[$y], "video" => $video));
247 | }
248 | }
249 | $memcout = count($membersidd)-1;
250 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام شما به ".$memcout." مخاطب ازسال شد.
251 | .","parse_mode" =>"HTML",'reply_markup' => array(
252 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
253 | 'one_time_keyboard' => true,
254 | 'selective' => true,
255 | 'resize_keyboard' => true)));
256 | $addd = "false";
257 | file_put_contents('booleans.txt',$addd);
258 | }
259 | }
260 | if (isset($message['sticker'])) {
261 |
262 | if ( $chat_id != $admin) {
263 |
264 | $txt = file_get_contents('banlist.txt');
265 | $membersid= explode("\n",$txt);
266 |
267 | $substr = substr($text, 0, 28);
268 | if (!in_array($chat_id,$membersid)) {
269 | apiRequest("forwardMessage", array('chat_id' => $admin, "from_chat_id"=> $chat_id ,"message_id" => $message_id));
270 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $pmembersiddd[1] ,"parse_mode" =>"HTML"));
271 | }else{
272 |
273 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "You Are Banned🚫
274 | Get Out Of Here Idiot🖕
275 | --------------------------------
276 | شما در لیست سیاه قرار دارید 🚫
277 | لطفا پیام ندهید🖕" ,"parse_mode" =>"HTML"));
278 |
279 | }
280 | }
281 | else if($rpto !="" && $chat_id==$admin){
282 | $sticker = $message['sticker']['file_id'];
283 |
284 | apiRequest("sendsticker", array('chat_id' => $rpto, "sticker" => $sticker));
285 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" =>"🗣پیام شما ارسال شد. " ,"parse_mode" =>"HTML"));
286 |
287 | }
288 |
289 | else if ($chat_id == $admin && $booleans[0] == "true") {
290 | $sticker = $message['sticker']['file_id'];
291 | $ttxtt = file_get_contents('pmembers.txt');
292 | $membersidd= explode("\n",$ttxtt);
293 | for($y=0;$y $membersidd[$y], "text" => $texttoall,"parse_mode" =>"HTML"));
295 |
296 | apiRequest("sendsticker", array('chat_id' => $membersidd[$y], "sticker" => $sticker));
297 |
298 |
299 |
300 | }
301 | $memcout = count($membersidd)-1;
302 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام شما به ".$memcout." مخاطب ازسال شد.
303 | .","parse_mode" =>"HTML",'reply_markup' => array(
304 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
305 | 'one_time_keyboard' => true,
306 | 'selective' => true,
307 | 'resize_keyboard' => true)));
308 | $addd = "false";
309 | file_put_contents('booleans.txt',$addd);
310 | }
311 | }
312 |
313 |
314 |
315 | if (isset($message['document'])) {
316 |
317 | if ( $chat_id != $admin) {
318 |
319 | $txt = file_get_contents('banlist.txt');
320 | $membersid= explode("\n",$txt);
321 |
322 | $substr = substr($text, 0, 28);
323 | if (!in_array($chat_id,$membersid)) {
324 | apiRequest("forwardMessage", array('chat_id' => $admin, "from_chat_id"=> $chat_id ,"message_id" => $message_id));
325 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $pmembersiddd[1],"parse_mode" =>"HTML"));
326 | }else{
327 |
328 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "You Are Banned🚫
329 | Get Out Of Here Idiot🖕
330 | --------------------------------
331 | شما در لیست سیاه قرار دارید 🚫
332 | لطفا پیام ندهید🖕" ,"parse_mode" =>"HTML"));
333 |
334 | }
335 | }
336 | else if($rpto !="" && $chat_id==$admin){
337 | $video = $message['document']['file_id'];
338 | $caption = $message['caption'];
339 | //apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $video ,"parse_mode" =>"HTML"));
340 | if($caption != "")
341 | {
342 | apiRequest("sendDocument", array('chat_id' => $rpto, "document" => $video,"caption" =>$caption));
343 | }
344 | else{
345 | apiRequest("sendDocument", array('chat_id' => $rpto, "document" => $video));
346 | }
347 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "🗣پیام شما ارسال شد. " ,"parse_mode" =>"HTML"));
348 |
349 | }
350 | else if ($chat_id == $admin && $booleans[0] == "true") {
351 | $video = $message['document']['file_id'];
352 | $ttxtt = file_get_contents('pmembers.txt');
353 | $membersidd= explode("\n",$ttxtt);
354 | for($y=0;$y $membersidd[$y], "document" => $video));
357 |
358 |
359 |
360 | }
361 | $memcout = count($membersidd)-1;
362 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام شما به ".$memcout." مخاطب ازسال شد.
363 | .","parse_mode" =>"HTML",'reply_markup' => array(
364 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
365 | 'one_time_keyboard' => true,
366 | 'selective' => true,
367 | 'resize_keyboard' => true)));
368 | $addd = "false";
369 | file_put_contents('booleans.txt',$addd);
370 | }
371 | }
372 | if (isset($message['voice'])) {
373 |
374 | if ( $chat_id != $admin) {
375 |
376 | $txt = file_get_contents('banlist.txt');
377 | $membersid= explode("\n",$txt);
378 |
379 | $substr = substr($text, 0, 28);
380 | if (!in_array($chat_id,$membersid)) {
381 | apiRequest("forwardMessage", array('chat_id' => $admin, "from_chat_id"=> $chat_id ,"message_id" => $message_id));
382 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $pmembersiddd[1] ,"parse_mode" =>"HTML"));
383 | }else{
384 |
385 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "You Are Banned🚫
386 | Get Out Of Here Idiot🖕
387 | --------------------------------
388 | شما در لیست سیاه قرار دارید 🚫
389 | لطفا پیام ندهید🖕" ,"parse_mode" =>"HTML"));
390 |
391 | }
392 | }
393 | else if($rpto !="" && $chat_id==$admin){
394 | $video = $message['voice']['file_id'];
395 | $caption = $message['caption'];
396 | //apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $video ,"parse_mode" =>"HTML"));
397 | if($caption != "")
398 | {
399 | apiRequest("sendVoice", array('chat_id' => $rpto, "voice" => $video,"caption" =>$caption));
400 | }
401 | else{
402 | apiRequest("sendVoice", array('chat_id' => $rpto, "voice" => $video));
403 | }
404 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" =>"🗣پیام شما ارسال شد. ","parse_mode" =>"HTML"));
405 |
406 | }
407 | else if ($chat_id == $admin && $booleans[0] == "true") {
408 | $video = $message['voice']['file_id'];
409 | $ttxtt = file_get_contents('pmembers.txt');
410 | $membersidd= explode("\n",$ttxtt);
411 | for($y=0;$y $membersidd[$y], "voice" => $video));
414 | }
415 | $memcout = count($membersidd)-1;
416 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام شما به ".$memcout." مخاطب ازسال شد.
417 | .","parse_mode" =>"HTML",'reply_markup' => array(
418 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
419 | 'one_time_keyboard' => true,
420 | 'selective' => true,
421 | 'resize_keyboard' => true)));
422 | $addd = "false";
423 | file_put_contents('booleans.txt',$addd);
424 | }
425 | }
426 | if (isset($message['audio'])) {
427 |
428 | if ( $chat_id != $admin) {
429 |
430 | $txt = file_get_contents('banlist.txt');
431 | $membersid= explode("\n",$txt);
432 |
433 | $substr = substr($text, 0, 28);
434 | if (!in_array($chat_id,$membersid)) {
435 | apiRequest("forwardMessage", array('chat_id' => $admin, "from_chat_id"=> $chat_id ,"message_id" => $message_id));
436 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $pmembersiddd[1] ,"parse_mode" =>"HTML"));
437 | }else{
438 |
439 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "You Are Banned🚫
440 | Get Out Of Here Idiot🖕
441 | --------------------------------
442 | شما در لیست سیاه قرار دارید 🚫
443 | لطفا پیام ندهید🖕" ,"parse_mode" =>"HTML"));
444 |
445 | }
446 | }
447 | else if($rpto !="" && $chat_id==$admin){
448 | $video = $message['audio']['file_id'];
449 | $caption = $message['caption'];
450 | //apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $video ,"parse_mode" =>"HTML"));
451 | if($caption != "")
452 | {
453 | apiRequest("sendaudio", array('chat_id' => $rpto, "audio" => $video,"caption" =>$caption));
454 | }
455 | else{
456 | apiRequest("sendaudio", array('chat_id' => $rpto, "audio" => $video));
457 | }
458 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "🗣پیام شما ارسال شد. " ,"parse_mode" =>"HTML"));
459 |
460 | }
461 | else if ($chat_id == $admin && $booleans[0] == "true") {
462 | $video = $message['audio']['file_id'];
463 | $ttxtt = file_get_contents('pmembers.txt');
464 | $membersidd= explode("\n",$ttxtt);
465 | for($y=0;$y $membersidd[$y], "audio" => $video));
468 |
469 | }
470 | $memcout = count($membersidd)-1;
471 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام شما به ".$memcout." مخاطب ازسال شد.
472 | .","parse_mode" =>"HTML",'reply_markup' => array(
473 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
474 | 'one_time_keyboard' => true,
475 | 'selective' => true,
476 | 'resize_keyboard' => true)));
477 | $addd = "false";
478 | file_put_contents('booleans.txt',$addd);
479 | }
480 | }
481 | if (isset($message['contact'])) {
482 |
483 | if ( $chat_id != $admin) {
484 |
485 | $txt = file_get_contents('banlist.txt');
486 | $membersid= explode("\n",$txt);
487 |
488 | $substr = substr($text, 0, 28);
489 | if (!in_array($chat_id,$membersid)) {
490 | apiRequest("forwardMessage", array('chat_id' => $admin, "from_chat_id"=> $chat_id ,"message_id" => $message_id));
491 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $pmembersiddd[1] ,"parse_mode" =>"HTML"));
492 | }else{
493 |
494 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "You Are Banned🚫
495 | Get Out Of Here Idiot🖕
496 | --------------------------------
497 | شما در لیست سیاه قرار دارید 🚫
498 | لطفا پیام ندهید🖕" ,"parse_mode" =>"HTML"));
499 |
500 | }
501 | }
502 | else if($rpto !="" && $chat_id==$admin){
503 | $phone = $message['contact']['phone_number'];
504 | $first = $message['contact']['first_name'];
505 |
506 | $last = $message['contact']['last_name'];
507 |
508 | //apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $video ,"parse_mode" =>"HTML"));
509 |
510 | apiRequest("sendcontact", array('chat_id' => $rpto, "phone_number" => $phone,"Last_name" =>$last,"first_name"=> $first));
511 |
512 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" =>"🗣پیام شما ارسال شد. ","parse_mode" =>"HTML"));
513 |
514 | }
515 | else if ($chat_id == $admin && $booleans[0] == "true") {
516 | $phone = $message['contact']['phone_number'];
517 | $first = $message['contact']['first_name'];
518 |
519 | $last = $message['contact']['last_name'];
520 | $ttxtt = file_get_contents('pmembers.txt');
521 | $membersidd= explode("\n",$ttxtt);
522 | for($y=0;$y $membersidd[$y], "phone_number" => $phone,"Last_name" =>$last,"first_name"=> $first));
525 |
526 | }
527 | $memcout = count($membersidd)-1;
528 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام شما به ".$memcout." مخاطب ازسال شد.
529 | .","parse_mode" =>"HTML",'reply_markup' => array(
530 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
531 | 'one_time_keyboard' => true,
532 | 'selective' => true,
533 | 'resize_keyboard' => true)));
534 | $addd = "false";
535 | file_put_contents('booleans.txt',$addd);
536 | }
537 | }
538 |
539 |
540 |
541 |
542 | if (isset($message['text'])) {
543 | // incoming text message
544 | $text = $message['text'];
545 | $matches = explode(" ", $text);
546 | if ($text=="/start") {
547 |
548 |
549 |
550 | if($chat_id!=$admin){
551 | apiRequest("sendMessage", array('chat_id' => $chat_id,"text"=>$pmembersiddd[0] ,"parse_mode"=>"HTML"));
552 |
553 | $txxt = file_get_contents('pmembers.txt');
554 | $pmembersid= explode("\n",$txxt);
555 | if (!in_array($chat_id,$pmembersid)) {
556 | $aaddd = file_get_contents('pmembers.txt');
557 | $aaddd .= $chat_id."
558 | ";
559 | file_put_contents('pmembers.txt',$aaddd);
560 | }
561 |
562 | }
563 | if($chat_id==$admin){
564 | apiRequestJson("sendMessage", array('chat_id' => $chat_id, "text" => ' سلام قربان حوش آمدید😉
565 | برای پاسخ روی پیام مورد نظر ریپلای کنید و متن خود را بنویسید 😎
566 | برای آشنایی دکمه ی ⚓️ Help️ را بزنید 👌😃
567 | .',"parse_mode"=>"MARKDOWN", 'reply_markup' => array(
568 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
569 | 'one_time_keyboard' => true,
570 | 'selective' => true,
571 | 'resize_keyboard' => true)));
572 | }
573 |
574 | } else if ($matches[0] == "/setstart" && $chat_id == $admin) {
575 |
576 | $starttext = str_replace("/setstart","",$text);
577 |
578 | file_put_contents('msgs.txt',$starttext."
579 |
580 | -!-@-#-$"."
581 | ".$pmembersiddd[1]);
582 | apiRequestJson("sendMessage", array('chat_id' => $chat_id, "text" =>"📝پیام خوش آمد گویی به 👇
583 |
584 | ".$starttext.""."
585 |
586 | 👆تغییر یافت
587 | ."));
588 |
589 |
590 |
591 |
592 | }
593 | else if ($matches[0] == "/setdone" && $chat_id == $admin) {
594 |
595 | $starttext = str_replace("/setdone","",$text);
596 |
597 | file_put_contents('msgs.txt',$pmembersiddd[0]."
598 |
599 | -!-@-#-$"."
600 | ".$starttext);
601 | apiRequestJson("sendMessage", array('chat_id' => $chat_id, "text" =>"📝پیام پیش فرض شما به 👇
602 |
603 | ".$starttext.""."
604 |
605 | 👆تغییر یافت
606 | ."));
607 |
608 |
609 |
610 |
611 | }
612 | else if ($text != "" && $chat_id != $admin) {
613 |
614 | $txt = file_get_contents('banlist.txt');
615 | $membersid= explode("\n",$txt);
616 |
617 | $substr = substr($text, 0, 28);
618 | if (!in_array($chat_id,$membersid)) {
619 | apiRequest("forwardMessage", array('chat_id' => $admin, "from_chat_id"=> $chat_id ,"message_id" => $message_id));
620 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" =>$pmembersiddd[1] ,"parse_mode" =>"HTML"));
621 |
622 | }else{
623 | if($substr !="thisisnarimanfrombeatbotteam"){
624 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "You Are Banned🚫
625 | Get Out Of Here Idiot🖕
626 | --------------------------------
627 | شما در لیست سیاه قرار دارید 🚫
628 | لطفا پیام ندهید🖕" ,"parse_mode" =>"HTML"));
629 | }
630 | else{
631 | $textfa =str_replace("thisisnarimanfrombeatbotteam","🖕",$text);;
632 | apiRequest("sendMessage", array('chat_id' => $admin, "text" => $textfa,"parse_mode" =>"HTML"));
633 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => $pmembersiddd[1] ,"parse_mode" =>"HTML"));
634 |
635 | }
636 | }
637 |
638 |
639 | }else if ($text == "Settings ⚙" && $chat_id==$admin) {
640 |
641 |
642 | apiRequestJson("sendMessage", array('chat_id' => $chat_id,"parse_mode"=>"HTML", "text" => '
643 | یکی از گزینه ها را انتخاب کنید
644 | —---------------------------------------------
645 | 🔶🔸 Clean Members
646 | 🔶🔸پاک کردن لیست مخاطبین
647 |
648 | 🔷🔹Clean Block List
649 | 🔷🔹پاک کردن لیست سیاه
650 |
651 | در صورت انصراف Back را بزنید
652 | .', 'reply_markup' => array(
653 | 'keyboard' => array(array('❌ Clean Members ','❌ Clean Block List '),array('🔙 Back')),
654 | 'one_time_keyboard' => true,
655 | 'selective' => true,
656 | 'resize_keyboard' => true)));
657 |
658 |
659 |
660 | }else if ($text == "⚓️ Help" && $chat_id==$admin) {
661 |
662 | apiRequest("sendMessage", array('chat_id' => $admin, "text" => "`برای پاسخ پیام مورد نظر را ریپلای کنید`
663 | 🔷 لیست کامنت های موجود :
664 |
665 | 🔹`1.` */ban*
666 | قرار دادن مخاطب در لیست سیاه(با ریپلای)
667 | —------------------------------
668 | 🔹`2. `*/unban *
669 | پاک کردن مخاطب از لیست سیاه(با ریپلای)
670 | —------------------------------
671 | 🔹`3. `*/setstart *
672 | اگر شخصی وارد ربات شما شود و */start* بزند این پیام برای او ارسال میشود */setstart* بزنید و در ادامه ی آن متن مورد نظر خود را بنویسید.
673 | مثال :
674 | */setstart* سلام چطوری؟ اگه پیامی داری واسه من همینجا بفرست😃
675 | —------------------------------
676 | 🔹`4. `*/setdone *
677 | اگر شخصی در ربات برای شما پیامی بفرستد این پیام برای او ارسال میشود.
678 | مثال :
679 | */setdone* پیامت رسید صبر کن تا جواب بدم
680 |
681 | ➖➖➖➖➖➖➖➖➖➖➖
682 | 🔶 لیست دکمه های موجود :
683 |
684 | 🔸`1.`*Send To All*
685 | ارسال پیام متنی به همه ی کاربران
686 | —------------------------------
687 | 🔸`2.`*Members*
688 | تعداد کاربران
689 | —------------------------------
690 | 🔸`3.`*Blocked Users*
691 | تعداد کاربران در لیست سیاه
692 | —-------------------------------
693 | 🔸`4.`*Settings*
694 | تنظیمان ربات
695 |
696 | .","parse_mode" =>"MARKDOWN",'reply_markup' => array(
697 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
698 | 'one_time_keyboard' => true,
699 | 'selective' => true,
700 | 'resize_keyboard' => true)));
701 |
702 | }else if ($text == "❌ Clean Members" && $chat_id==$admin) {
703 |
704 |
705 | $txxt = file_get_contents('pmembers.txt');
706 | $pmembersid= explode("\n",$txxt);
707 | file_put_contents('pmembers.txt',"");
708 | apiRequestJson("sendMessage", array('chat_id' => $chat_id,"parse_mode"=>"HTML", "text" => 'لیست مخاطبین پاک شد ✔️
709 | .', 'reply_markup' => array(
710 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
711 | 'one_time_keyboard' => true,
712 | 'selective' => true,
713 | 'resize_keyboard' => true)));
714 | }
715 | else if ($text == "❌ Clean Block List" && $chat_id==$admin) {
716 |
717 |
718 | $txxt = file_get_contents('banlist.txt');
719 | $pmembersid= explode("\n",$txxt);
720 | file_put_contents('banlist.txt',"");
721 | apiRequestJson("sendMessage", array('chat_id' => $chat_id,"parse_mode"=>"HTML", "text" => 'لیست سیاه پاک شد ✔ ', 'reply_markup' => array(
722 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
723 | 'one_time_keyboard' => true,
724 | 'selective' => true,
725 | 'resize_keyboard' => true)));
726 | }
727 | else if ($text == "🔙 Back" && $chat_id==$admin) {
728 | apiRequestJson("sendMessage", array('chat_id' => $chat_id, "text" => 'سلام قربان حوش آمدید😉
729 | برای پاسخ روی پیام مورد نظر ریپلای کنید و متن خود را بنویسید 😎
730 | برای آشنایی دکمه ی ⚓️ Help️ را بزنید 👌😃
731 | .', 'reply_markup' => array(
732 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
733 | 'one_time_keyboard' => true,
734 | 'selective' => true,
735 | 'resize_keyboard' => true)));
736 |
737 |
738 |
739 | }
740 | else if ($text =="🗣 Send To All" && $chat_id == $admin && $booleans[0]=="false") {
741 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام خود را ارسال کنید ." ,"parse_mode" =>"HTML"));
742 | $boolean = file_get_contents('booleans.txt');
743 | $booleans= explode("\n",$boolean);
744 | $addd = file_get_contents('banlist.txt');
745 | $addd = "true";
746 | file_put_contents('booleans.txt',$addd);
747 |
748 | }
749 | else if ($chat_id == $admin && $booleans[0] == "true") {
750 | $texttoall =$text;
751 | $ttxtt = file_get_contents('pmembers.txt');
752 | $membersidd= explode("\n",$ttxtt);
753 | for($y=0;$y $membersidd[$y], "text" => $texttoall,"parse_mode" =>"HTML"));
755 | }
756 | $memcout = count($membersidd)-1;
757 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "📦 پیام شما به ".$memcout." مخاطب ازسال شد.
758 | .","parse_mode" =>"HTML",'reply_markup' => array(
759 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
760 | 'one_time_keyboard' => true,
761 | 'selective' => true,
762 | 'resize_keyboard' => true)));
763 | $addd = "false";
764 | file_put_contents('booleans.txt',$addd);
765 | }else if($text == "👥 Members" && $chat_id == $admin ){
766 | $txtt = file_get_contents('pmembers.txt');
767 | $membersidd= explode("\n",$txtt);
768 | $mmemcount = count($membersidd) -1;
769 | apiRequestJson("sendMessage", array('chat_id' => $chat_id,"parse_mode" =>"HTML", "text" => "✅ تعداد کل مخاطبان : ".$mmemcount,'reply_markup' => array(
770 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
771 | 'one_time_keyboard' => true,
772 | 'selective' => true,
773 | 'resize_keyboard' => true)));
774 |
775 |
776 | }else if($text == "❌ Blocked Users" && $chat_id == $admin ){
777 | $txtt = file_get_contents('banlist.txt');
778 | $membersidd= explode("\n",$txtt);
779 | $mmemcount = count($membersidd) -1;
780 | apiRequestJson("sendMessage", array('chat_id' => $chat_id,"parse_mode" =>"HTML", "text" => "🚫 تعداد کل افرادی که در لیست سیاه قرار دارند : ".$mmemcount,'reply_markup' => array(
781 | 'keyboard' => array(array('🗣 Send To All'),array('⚓️ Help','👥 Members','❌ Blocked Users'),array("Settings ⚙")),
782 | 'one_time_keyboard' => true,
783 | 'selective' => true,
784 | 'resize_keyboard' => true)));
785 |
786 |
787 | }
788 | else if($rpto != "" && $chat_id == $admin){
789 | if($text != "/ban" && $text != "/unban")
790 | {
791 | apiRequest("sendMessage", array('chat_id' => $rpto, "text" => $text ,"parse_mode" =>"HTML"));
792 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "🗣پیام شما ارسال شد. " ,"parse_mode" =>"HTML"));
793 | }
794 | else
795 | {
796 | if($text == "/ban"){
797 | $txtt = file_get_contents('banlist.txt');
798 | $banid= explode("\n",$txtt);
799 | if (!in_array($rpto,$banid)) {
800 | $addd = file_get_contents('banlist.txt');
801 | $addd = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "", $addd);
802 | $addd .= $rpto."
803 | ";
804 |
805 | file_put_contents('banlist.txt',$addd);
806 | apiRequest("sendMessage", array('chat_id' => $rpto, "text" => "You Are Banned🚫,
807 | -----------------
808 | شما در لیست سیاه قرار گرفتید🚫." ,"parse_mode" =>"HTML"));
809 | }
810 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "Banned
811 | ➖➖➖➖➖➖➖➖➖➖➖
812 | به لیست سیاه افزوده شد." ,"parse_mode" =>"HTML"));
813 | }
814 | if($text == "/unban"){
815 | $txttt = file_get_contents('banlist.txt');
816 | $banidd= explode("\n",$txttt);
817 | if (in_array($rpto,$banidd)) {
818 | $adddd = file_get_contents('banlist.txt');
819 | $adddd = str_replace($rpto,"",$adddd);
820 | $adddd = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "", $adddd);
821 | $adddd .="
822 | ";
823 |
824 |
825 | $banid= explode("\n",$adddd);
826 | if($banid[1]=="")
827 | $adddd = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "", $adddd);
828 |
829 | file_put_contents('banlist.txt',$adddd);
830 | }
831 | apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "UnBanned
832 | ------------------
833 | از لیست سیاه پاک شد." ,"parse_mode" =>"HTML"));
834 | apiRequest("sendMessage", array('chat_id' => $rpto, "text" => "You Have Been UnBanned⚙,
835 | -----------------
836 | شما از لیست سیاه پاک شدید ⚙." ,"parse_mode" =>"HTML"));
837 | }
838 | }
839 | }
840 | } else {
841 |
842 | }
843 | }
844 |
845 |
846 | define('WEBHOOK_URL', 'https://my-site.example.com/secret-path-for-webhooks/');
847 |
848 | if (php_sapi_name() == 'cli') {
849 | // if run from console, set or delete webhook
850 | apiRequest('setWebhook', array('url' => isset($argv[1]) && $argv[1] == 'delete' ? '' : WEBHOOK_URL));
851 | exit;
852 | }
853 |
854 |
855 | $content = file_get_contents("php://input");
856 | $update = json_decode($content, true);
857 |
858 | if (!$update) {
859 | // receive wrong update, must not happen
860 | exit;
861 | }
862 |
863 | if (isset($update["message"])) {
864 | processMessage($update["message"]);
865 | }
866 |
--------------------------------------------------------------------------------