Passed
Push — master ( 254b0a...0f074f )
by Behzad
01:24
created
main.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,5 +21,5 @@
 block discarded – undo
21 21
 }
22 22
 
23 23
 if (Get::$text == 'hi') Send::sendMessage(Get::$chat_id, 'Hello!');
24
-$admins=explode(',',getenv('ADMINS'));
24
+$admins = explode(',', getenv('ADMINS'));
25 25
 foreach ($admins as $admin) Send::sendMessage($admin, 'bot is run');
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,6 +20,10 @@
 block discarded – undo
20 20
     Get::set($tg->getWebhookUpdates());
21 21
 }
22 22
 
23
-if (Get::$text == 'hi') Send::sendMessage(Get::$chat_id, 'Hello!');
23
+if (Get::$text == 'hi') {
24
+    Send::sendMessage(Get::$chat_id, 'Hello!');
25
+}
24 26
 $admins=explode(',',getenv('ADMINS'));
25
-foreach ($admins as $admin) Send::sendMessage($admin, 'bot is run');
27
+foreach ($admins as $admin) {
28
+    Send::sendMessage($admin, 'bot is run');
29
+}
Please login to merge, or discard this patch.
group.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -520,7 +520,7 @@
 block discarded – undo
520 520
                 Send::sendMessage(Get::$chat_id, 'گروه قفل شد', 'HTML', false, false, null);
521 521
                 $permission = [
522 522
                         'can_send_messages' => false,
523
-                     ];
523
+                        ];
524 524
                 Chat::setChatPermissions(Get::$chat_id, $permission);
525 525
             } elseif (Get::$text == 'باز کردن گروه') {
526 526
                 Send::sendMessage(Get::$chat_id, 'گروه باز شد', 'HTML', false, false, null);
Please login to merge, or discard this patch.
Braces   +237 added lines, -79 removed lines patch added patch discarded remove patch
@@ -205,34 +205,82 @@  discard block
 block discarded – undo
205 205
     if (!in_array($user_id, $sudors) && $user_id != $Group->Creator && !in_array($user_id, $Group->Administrators) && !in_array($user_id, $Group->WhiteListUsers)) {
206 206
         foreach($Group->MSGs as $key => $value){
207 207
             $text = $value->MSG;
208
-            if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
209
-            if (strpos($text, '~USER_ID~')) $text = str_replace('~USER_ID~', Get::$from_id, $text);
210
-            if (strpos($text, '~FIRST_NAME~')) $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
211
-            if (strpos($text, '~LAST_NAME~')) $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
212
-            if (strpos($text, '~USERNAME~')) $text = str_replace('~USERNAME~', Get::$from_username, $text);
208
+            if (strpos($text, '-MENTION')) {
209
+                $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
210
+            }
211
+            if (strpos($text, '~USER_ID~')) {
212
+                $text = str_replace('~USER_ID~', Get::$from_id, $text);
213
+            }
214
+            if (strpos($text, '~FIRST_NAME~')) {
215
+                $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
216
+            }
217
+            if (strpos($text, '~LAST_NAME~')) {
218
+                $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
219
+            }
220
+            if (strpos($text, '~USERNAME~')) {
221
+                $text = str_replace('~USERNAME~', Get::$from_username, $text);
222
+            }
213 223
             //
214
-            if (strpos($text, '~GROUP_ID~')) $text = str_replace('~GROUP_ID~', '@' . Get::$chat_id, $text);
215
-            if (strpos($text, '~GROUP_TITLE~')) $text = str_replace('~GROUP_TITLE~', Get::$chat_title, $text);
216
-            if (strpos($text, '~GROUP_USERNAME~')) $text = str_replace('~GROUP_USERNAME~', '@' . Get::$chat_username, $text);
224
+            if (strpos($text, '~GROUP_ID~')) {
225
+                $text = str_replace('~GROUP_ID~', '@' . Get::$chat_id, $text);
226
+            }
227
+            if (strpos($text, '~GROUP_TITLE~')) {
228
+                $text = str_replace('~GROUP_TITLE~', Get::$chat_title, $text);
229
+            }
230
+            if (strpos($text, '~GROUP_USERNAME~')) {
231
+                $text = str_replace('~GROUP_USERNAME~', '@' . Get::$chat_username, $text);
232
+            }
217 233
             //
218
-            if (strpos($text, '~NEW_USER_ID~')) $text = str_replace('~NEW_USER_ID~', Get::$new_chat_member_id, $text);
219
-            if (strpos($text, '~NEW_FIRST_NAME~')) $text = str_replace('~NEW_FIRST_NAME~', Get::$new_chat_member_first_name, $text);
220
-            if (strpos($text, '~NEW_LAST_NAME~')) $text = str_replace('~NEW_LAST_NAME~', Get::$new_chat_member_last_name, $text);
221
-            if (strpos($text, '~NEW_USERNAME~')) $text = str_replace('~NEW_USERNAME~', Get::$new_chat_member_username, $text);
234
+            if (strpos($text, '~NEW_USER_ID~')) {
235
+                $text = str_replace('~NEW_USER_ID~', Get::$new_chat_member_id, $text);
236
+            }
237
+            if (strpos($text, '~NEW_FIRST_NAME~')) {
238
+                $text = str_replace('~NEW_FIRST_NAME~', Get::$new_chat_member_first_name, $text);
239
+            }
240
+            if (strpos($text, '~NEW_LAST_NAME~')) {
241
+                $text = str_replace('~NEW_LAST_NAME~', Get::$new_chat_member_last_name, $text);
242
+            }
243
+            if (strpos($text, '~NEW_USERNAME~')) {
244
+                $text = str_replace('~NEW_USERNAME~', Get::$new_chat_member_username, $text);
245
+            }
222 246
             //
223
-            if (strpos($text, '~IN_REPLY_ID~')) $text = str_replace('~IN_REPLY_ID~', Get::$reply_to_from_id, $text);
224
-            if (strpos($text, '~IN_REPLY_FIRST_NAME~')) $text = str_replace('~IN_REPLY_FIRST_NAME~', Get::$reply_to_from_first_name, $text);
225
-            if (strpos($text, '~IN_REPLY_LAST_NAME~')) $text = str_replace('~IN_REPLY_LAST_NAME~', Get::$reply_to_from_last_name, $text);
226
-            if (strpos($text, '~IN_REPLY_USERNAME~')) $text = str_replace('~IN_REPLY_USERNAME~', Get::$reply_to_from_username, $text);
247
+            if (strpos($text, '~IN_REPLY_ID~')) {
248
+                $text = str_replace('~IN_REPLY_ID~', Get::$reply_to_from_id, $text);
249
+            }
250
+            if (strpos($text, '~IN_REPLY_FIRST_NAME~')) {
251
+                $text = str_replace('~IN_REPLY_FIRST_NAME~', Get::$reply_to_from_first_name, $text);
252
+            }
253
+            if (strpos($text, '~IN_REPLY_LAST_NAME~')) {
254
+                $text = str_replace('~IN_REPLY_LAST_NAME~', Get::$reply_to_from_last_name, $text);
255
+            }
256
+            if (strpos($text, '~IN_REPLY_USERNAME~')) {
257
+                $text = str_replace('~IN_REPLY_USERNAME~', Get::$reply_to_from_username, $text);
258
+            }
227 259
             //
228
-            if (strpos($text, '~ENTER~')) $text = str_replace('~ENTER~', "\n", $text);
229
-            if (strpos($text, '~CREATOR_ID~')) $text = str_replace('~CREATOR_ID~', $Group->Creator, $text);
230
-            if (strpos($text, '~GP_CHANNEL~')) $text = str_replace('~GP_CHANNEL~', $Group->Creator, $text);
231
-            if (strpos($text, '~CAPTCHASENDNUM~')) $text = str_replace('~CAPTCHASENDNUM~', $User->CaptchaSendNum, $text);
232
-            if (strpos($text, '~USERWARNCOUNT~')) $text = str_replace('~USERWARNCOUNT~', $Member->WarnCount, $text);
233
-            if (strpos($text, '~WARNNUMBERTOREMOVE~')) $text = str_replace('~WARNNUMBERTOREMOVE~', $Group->WarnNumberToRemove, $text);
234
-            if (strpos($text, '~ADD_NUMBER~')) $text = str_replace('~ADD_NUMBER~', $Member->AddNumber, $text);
235
-            if (strpos($text, '~SHOULD_ADD_NUMBER~')) $text = str_replace('~SHOULD_ADD_NUMBER~', $Group->AddNumber, $text);
260
+            if (strpos($text, '~ENTER~')) {
261
+                $text = str_replace('~ENTER~', "\n", $text);
262
+            }
263
+            if (strpos($text, '~CREATOR_ID~')) {
264
+                $text = str_replace('~CREATOR_ID~', $Group->Creator, $text);
265
+            }
266
+            if (strpos($text, '~GP_CHANNEL~')) {
267
+                $text = str_replace('~GP_CHANNEL~', $Group->Creator, $text);
268
+            }
269
+            if (strpos($text, '~CAPTCHASENDNUM~')) {
270
+                $text = str_replace('~CAPTCHASENDNUM~', $User->CaptchaSendNum, $text);
271
+            }
272
+            if (strpos($text, '~USERWARNCOUNT~')) {
273
+                $text = str_replace('~USERWARNCOUNT~', $Member->WarnCount, $text);
274
+            }
275
+            if (strpos($text, '~WARNNUMBERTOREMOVE~')) {
276
+                $text = str_replace('~WARNNUMBERTOREMOVE~', $Group->WarnNumberToRemove, $text);
277
+            }
278
+            if (strpos($text, '~ADD_NUMBER~')) {
279
+                $text = str_replace('~ADD_NUMBER~', $Member->AddNumber, $text);
280
+            }
281
+            if (strpos($text, '~SHOULD_ADD_NUMBER~')) {
282
+                $text = str_replace('~SHOULD_ADD_NUMBER~', $Group->AddNumber, $text);
283
+            }
236 284
             $Group->MSGs->$key->MSG = $text;
237 285
         }
238 286
         if (Get::$new_chat_member_id) {
@@ -387,34 +435,82 @@  discard block
 block discarded – undo
387 435
                     $Member = $DB->SelectData('Groups/' . Get::$chat_id . '/Users', Get::$reply_to_from_id, ['User_id' => Get::$reply_to_from_id]);
388 436
                     $Member->WarnCount = $Member->WarnCount +1;
389 437
                     $text = $Group->MSGs->WarnMSG->MSG;
390
-                    if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
391
-                    if (strpos($text, '~USER_ID~')) $text = str_replace('~USER_ID~', Get::$from_id, $text);
392
-                    if (strpos($text, '~FIRST_NAME~')) $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
393
-                    if (strpos($text, '~LAST_NAME~')) $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
394
-                    if (strpos($text, '~USERNAME~')) $text = str_replace('~USERNAME~', Get::$from_username, $text);
438
+                    if (strpos($text, '-MENTION')) {
439
+                        $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
440
+                    }
441
+                    if (strpos($text, '~USER_ID~')) {
442
+                        $text = str_replace('~USER_ID~', Get::$from_id, $text);
443
+                    }
444
+                    if (strpos($text, '~FIRST_NAME~')) {
445
+                        $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
446
+                    }
447
+                    if (strpos($text, '~LAST_NAME~')) {
448
+                        $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
449
+                    }
450
+                    if (strpos($text, '~USERNAME~')) {
451
+                        $text = str_replace('~USERNAME~', Get::$from_username, $text);
452
+                    }
395 453
                     //
396
-                    if (strpos($text, '~GROUP_ID~')) $text = str_replace('~GROUP_ID~', '@' . Get::$chat_id, $text);
397
-                    if (strpos($text, '~GROUP_TITLE~')) $text = str_replace('~GROUP_TITLE~', Get::$chat_title, $text);
398
-                    if (strpos($text, '~GROUP_USERNAME~')) $text = str_replace('~GROUP_USERNAME~', '@' . Get::$chat_username, $text);
454
+                    if (strpos($text, '~GROUP_ID~')) {
455
+                        $text = str_replace('~GROUP_ID~', '@' . Get::$chat_id, $text);
456
+                    }
457
+                    if (strpos($text, '~GROUP_TITLE~')) {
458
+                        $text = str_replace('~GROUP_TITLE~', Get::$chat_title, $text);
459
+                    }
460
+                    if (strpos($text, '~GROUP_USERNAME~')) {
461
+                        $text = str_replace('~GROUP_USERNAME~', '@' . Get::$chat_username, $text);
462
+                    }
399 463
                     //
400
-                    if (strpos($text, '~NEW_USER_ID~')) $text = str_replace('~NEW_USER_ID~', Get::$new_chat_member_id, $text);
401
-                    if (strpos($text, '~NEW_FIRST_NAME~')) $text = str_replace('~NEW_FIRST_NAME~', Get::$new_chat_member_first_name, $text);
402
-                    if (strpos($text, '~NEW_LAST_NAME~')) $text = str_replace('~NEW_LAST_NAME~', Get::$new_chat_member_last_name, $text);
403
-                    if (strpos($text, '~NEW_USERNAME~')) $text = str_replace('~NEW_USERNAME~', Get::$new_chat_member_username, $text);
464
+                    if (strpos($text, '~NEW_USER_ID~')) {
465
+                        $text = str_replace('~NEW_USER_ID~', Get::$new_chat_member_id, $text);
466
+                    }
467
+                    if (strpos($text, '~NEW_FIRST_NAME~')) {
468
+                        $text = str_replace('~NEW_FIRST_NAME~', Get::$new_chat_member_first_name, $text);
469
+                    }
470
+                    if (strpos($text, '~NEW_LAST_NAME~')) {
471
+                        $text = str_replace('~NEW_LAST_NAME~', Get::$new_chat_member_last_name, $text);
472
+                    }
473
+                    if (strpos($text, '~NEW_USERNAME~')) {
474
+                        $text = str_replace('~NEW_USERNAME~', Get::$new_chat_member_username, $text);
475
+                    }
404 476
                     //
405
-                    if (strpos($text, '~IN_REPLY_ID~')) $text = str_replace('~IN_REPLY_ID~', Get::$reply_to_from_id, $text);
406
-                    if (strpos($text, '~IN_REPLY_FIRST_NAME~')) $text = str_replace('~IN_REPLY_FIRST_NAME~', Get::$reply_to_from_first_name, $text);
407
-                    if (strpos($text, '~IN_REPLY_LAST_NAME~')) $text = str_replace('~IN_REPLY_LAST_NAME~', Get::$reply_to_from_last_name, $text);
408
-                    if (strpos($text, '~IN_REPLY_USERNAME~')) $text = str_replace('~IN_REPLY_USERNAME~', Get::$reply_to_from_username, $text);
477
+                    if (strpos($text, '~IN_REPLY_ID~')) {
478
+                        $text = str_replace('~IN_REPLY_ID~', Get::$reply_to_from_id, $text);
479
+                    }
480
+                    if (strpos($text, '~IN_REPLY_FIRST_NAME~')) {
481
+                        $text = str_replace('~IN_REPLY_FIRST_NAME~', Get::$reply_to_from_first_name, $text);
482
+                    }
483
+                    if (strpos($text, '~IN_REPLY_LAST_NAME~')) {
484
+                        $text = str_replace('~IN_REPLY_LAST_NAME~', Get::$reply_to_from_last_name, $text);
485
+                    }
486
+                    if (strpos($text, '~IN_REPLY_USERNAME~')) {
487
+                        $text = str_replace('~IN_REPLY_USERNAME~', Get::$reply_to_from_username, $text);
488
+                    }
409 489
                     //
410
-                    if (strpos($text, '~ENTER~')) $text = str_replace('~ENTER~', "\n", $text);
411
-                    if (strpos($text, '~CREATOR_ID~')) $text = str_replace('~CREATOR_ID~', $Group->Creator, $text);
412
-                    if (strpos($text, '~GP_CHANNEL~')) $text = str_replace('~GP_CHANNEL~', $Group->Creator, $text);
413
-                    if (strpos($text, '~CAPTCHASENDNUM~')) $text = str_replace('~CAPTCHASENDNUM~', $User->CaptchaSendNum, $text);
414
-                    if (strpos($text, '~USERWARNCOUNT~')) $text = str_replace('~USERWARNCOUNT~', $Member->WarnCount, $text);
415
-                    if (strpos($text, '~WARNNUMBERTOREMOVE~')) $text = str_replace('~WARNNUMBERTOREMOVE~', $Group->WarnNumberToRemove, $text);
416
-                    if (strpos($text, '~ADD_NUMBER~')) $text = str_replace('~ADD_NUMBER~', $Member->AddNumber, $text);
417
-                    if (strpos($text, '~SHOULD_ADD_NUMBER~')) $text = str_replace('~SHOULD_ADD_NUMBER~', $Group->AddNumber, $text);
490
+                    if (strpos($text, '~ENTER~')) {
491
+                        $text = str_replace('~ENTER~', "\n", $text);
492
+                    }
493
+                    if (strpos($text, '~CREATOR_ID~')) {
494
+                        $text = str_replace('~CREATOR_ID~', $Group->Creator, $text);
495
+                    }
496
+                    if (strpos($text, '~GP_CHANNEL~')) {
497
+                        $text = str_replace('~GP_CHANNEL~', $Group->Creator, $text);
498
+                    }
499
+                    if (strpos($text, '~CAPTCHASENDNUM~')) {
500
+                        $text = str_replace('~CAPTCHASENDNUM~', $User->CaptchaSendNum, $text);
501
+                    }
502
+                    if (strpos($text, '~USERWARNCOUNT~')) {
503
+                        $text = str_replace('~USERWARNCOUNT~', $Member->WarnCount, $text);
504
+                    }
505
+                    if (strpos($text, '~WARNNUMBERTOREMOVE~')) {
506
+                        $text = str_replace('~WARNNUMBERTOREMOVE~', $Group->WarnNumberToRemove, $text);
507
+                    }
508
+                    if (strpos($text, '~ADD_NUMBER~')) {
509
+                        $text = str_replace('~ADD_NUMBER~', $Member->AddNumber, $text);
510
+                    }
511
+                    if (strpos($text, '~SHOULD_ADD_NUMBER~')) {
512
+                        $text = str_replace('~SHOULD_ADD_NUMBER~', $Group->AddNumber, $text);
513
+                    }
418 514
                     $DB->UpdateData('Groups/' . Get::$chat_id . '/Users', Get::$reply_to_from_id, ['WarnCount' => $Member->WarnCount], ['User_id' =>  Get::$reply_to_from_id]);
419 515
                     if ($Member->WarnCount > $Group->WarnNumberToRemove) {
420 516
                         Chat::kickChatMember(Get::$chat_id, Get::$reply_to_from_id);
@@ -428,34 +524,82 @@  discard block
 block discarded – undo
428 524
                 $Member = $DB->SelectData('Groups/' . Get::$chat_id . '/Users', Get::$reply_to_from_id, ['User_id' => Get::$reply_to_from_id]);
429 525
                     $Member->WarnCount = $Member->WarnCount -1;
430 526
                     $text = $Group->MSGs->WarnMSG->MSG;
431
-                    if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
432
-                    if (strpos($text, '~USER_ID~')) $text = str_replace('~USER_ID~', Get::$from_id, $text);
433
-                    if (strpos($text, '~FIRST_NAME~')) $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
434
-                    if (strpos($text, '~LAST_NAME~')) $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
435
-                    if (strpos($text, '~USERNAME~')) $text = str_replace('~USERNAME~', Get::$from_username, $text);
527
+                    if (strpos($text, '-MENTION')) {
528
+                        $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
529
+                    }
530
+                    if (strpos($text, '~USER_ID~')) {
531
+                        $text = str_replace('~USER_ID~', Get::$from_id, $text);
532
+                    }
533
+                    if (strpos($text, '~FIRST_NAME~')) {
534
+                        $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
535
+                    }
536
+                    if (strpos($text, '~LAST_NAME~')) {
537
+                        $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
538
+                    }
539
+                    if (strpos($text, '~USERNAME~')) {
540
+                        $text = str_replace('~USERNAME~', Get::$from_username, $text);
541
+                    }
436 542
                     //
437
-                    if (strpos($text, '~GROUP_ID~')) $text = str_replace('~GROUP_ID~', '@' . Get::$chat_id, $text);
438
-                    if (strpos($text, '~GROUP_TITLE~')) $text = str_replace('~GROUP_TITLE~', Get::$chat_title, $text);
439
-                    if (strpos($text, '~GROUP_USERNAME~')) $text = str_replace('~GROUP_USERNAME~', '@' . Get::$chat_username, $text);
543
+                    if (strpos($text, '~GROUP_ID~')) {
544
+                        $text = str_replace('~GROUP_ID~', '@' . Get::$chat_id, $text);
545
+                    }
546
+                    if (strpos($text, '~GROUP_TITLE~')) {
547
+                        $text = str_replace('~GROUP_TITLE~', Get::$chat_title, $text);
548
+                    }
549
+                    if (strpos($text, '~GROUP_USERNAME~')) {
550
+                        $text = str_replace('~GROUP_USERNAME~', '@' . Get::$chat_username, $text);
551
+                    }
440 552
                     //
441
-                    if (strpos($text, '~NEW_USER_ID~')) $text = str_replace('~NEW_USER_ID~', Get::$new_chat_member_id, $text);
442
-                    if (strpos($text, '~NEW_FIRST_NAME~')) $text = str_replace('~NEW_FIRST_NAME~', Get::$new_chat_member_first_name, $text);
443
-                    if (strpos($text, '~NEW_LAST_NAME~')) $text = str_replace('~NEW_LAST_NAME~', Get::$new_chat_member_last_name, $text);
444
-                    if (strpos($text, '~NEW_USERNAME~')) $text = str_replace('~NEW_USERNAME~', Get::$new_chat_member_username, $text);
553
+                    if (strpos($text, '~NEW_USER_ID~')) {
554
+                        $text = str_replace('~NEW_USER_ID~', Get::$new_chat_member_id, $text);
555
+                    }
556
+                    if (strpos($text, '~NEW_FIRST_NAME~')) {
557
+                        $text = str_replace('~NEW_FIRST_NAME~', Get::$new_chat_member_first_name, $text);
558
+                    }
559
+                    if (strpos($text, '~NEW_LAST_NAME~')) {
560
+                        $text = str_replace('~NEW_LAST_NAME~', Get::$new_chat_member_last_name, $text);
561
+                    }
562
+                    if (strpos($text, '~NEW_USERNAME~')) {
563
+                        $text = str_replace('~NEW_USERNAME~', Get::$new_chat_member_username, $text);
564
+                    }
445 565
                     //
446
-                    if (strpos($text, '~IN_REPLY_ID~')) $text = str_replace('~IN_REPLY_ID~', Get::$reply_to_from_id, $text);
447
-                    if (strpos($text, '~IN_REPLY_FIRST_NAME~')) $text = str_replace('~IN_REPLY_FIRST_NAME~', Get::$reply_to_from_first_name, $text);
448
-                    if (strpos($text, '~IN_REPLY_LAST_NAME~')) $text = str_replace('~IN_REPLY_LAST_NAME~', Get::$reply_to_from_last_name, $text);
449
-                    if (strpos($text, '~IN_REPLY_USERNAME~')) $text = str_replace('~IN_REPLY_USERNAME~', Get::$reply_to_from_username, $text);
566
+                    if (strpos($text, '~IN_REPLY_ID~')) {
567
+                        $text = str_replace('~IN_REPLY_ID~', Get::$reply_to_from_id, $text);
568
+                    }
569
+                    if (strpos($text, '~IN_REPLY_FIRST_NAME~')) {
570
+                        $text = str_replace('~IN_REPLY_FIRST_NAME~', Get::$reply_to_from_first_name, $text);
571
+                    }
572
+                    if (strpos($text, '~IN_REPLY_LAST_NAME~')) {
573
+                        $text = str_replace('~IN_REPLY_LAST_NAME~', Get::$reply_to_from_last_name, $text);
574
+                    }
575
+                    if (strpos($text, '~IN_REPLY_USERNAME~')) {
576
+                        $text = str_replace('~IN_REPLY_USERNAME~', Get::$reply_to_from_username, $text);
577
+                    }
450 578
                     //
451
-                    if (strpos($text, '~ENTER~')) $text = str_replace('~ENTER~', "\n", $text);
452
-                    if (strpos($text, '~CREATOR_ID~')) $text = str_replace('~CREATOR_ID~', $Group->Creator, $text);
453
-                    if (strpos($text, '~GP_CHANNEL~')) $text = str_replace('~GP_CHANNEL~', $Group->Creator, $text);
454
-                    if (strpos($text, '~CAPTCHASENDNUM~')) $text = str_replace('~CAPTCHASENDNUM~', $User->CaptchaSendNum, $text);
455
-                    if (strpos($text, '~USERWARNCOUNT~')) $text = str_replace('~USERWARNCOUNT~', $Member->WarnCount, $text);
456
-                    if (strpos($text, '~WARNNUMBERTOREMOVE~')) $text = str_replace('~WARNNUMBERTOREMOVE~', $Group->WarnNumberToRemove, $text);
457
-                    if (strpos($text, '~ADD_NUMBER~')) $text = str_replace('~ADD_NUMBER~', $Member->AddNumber, $text);
458
-                    if (strpos($text, '~SHOULD_ADD_NUMBER~')) $text = str_replace('~SHOULD_ADD_NUMBER~', $Group->AddNumber, $text);
579
+                    if (strpos($text, '~ENTER~')) {
580
+                        $text = str_replace('~ENTER~', "\n", $text);
581
+                    }
582
+                    if (strpos($text, '~CREATOR_ID~')) {
583
+                        $text = str_replace('~CREATOR_ID~', $Group->Creator, $text);
584
+                    }
585
+                    if (strpos($text, '~GP_CHANNEL~')) {
586
+                        $text = str_replace('~GP_CHANNEL~', $Group->Creator, $text);
587
+                    }
588
+                    if (strpos($text, '~CAPTCHASENDNUM~')) {
589
+                        $text = str_replace('~CAPTCHASENDNUM~', $User->CaptchaSendNum, $text);
590
+                    }
591
+                    if (strpos($text, '~USERWARNCOUNT~')) {
592
+                        $text = str_replace('~USERWARNCOUNT~', $Member->WarnCount, $text);
593
+                    }
594
+                    if (strpos($text, '~WARNNUMBERTOREMOVE~')) {
595
+                        $text = str_replace('~WARNNUMBERTOREMOVE~', $Group->WarnNumberToRemove, $text);
596
+                    }
597
+                    if (strpos($text, '~ADD_NUMBER~')) {
598
+                        $text = str_replace('~ADD_NUMBER~', $Member->AddNumber, $text);
599
+                    }
600
+                    if (strpos($text, '~SHOULD_ADD_NUMBER~')) {
601
+                        $text = str_replace('~SHOULD_ADD_NUMBER~', $Group->AddNumber, $text);
602
+                    }
459 603
                 $DB->UpdateData('Groups/' . Get::$chat_id . '/Users', Get::$reply_to_from_id, ['WarnCount' => $Member->WarnCount], ['User_id' =>  Get::$reply_to_from_id]);
460 604
                 $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->delWarnMSG->MSG, 'HTML');
461 605
                 $DB->InsertData('Bot', 'Temp', ['Type'=>'Warn','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
@@ -771,7 +915,9 @@  discard block
 block discarded – undo
771 915
                 }
772 916
                 $photo = end($UserInfo->result->photos[0])->file_id;
773 917
                 $msg = 'نام : '.Get::$from_first_name.' '.Get::$from_last_name;
774
-                if(Get::$from_username) $msg .="\n\n نام کاربری : ".Get::$from_username;
918
+                if(Get::$from_username) {
919
+                    $msg .="\n\n نام کاربری : ".Get::$from_username;
920
+                }
775 921
                 $msg .="\n\n یوزر آیدی : ".Get::$from_id."\n\n تعداد پیام های ارسالی در گروه‌ها : ".$User->MSGCount."\n\n تعداد تشکر ها : ".$User->ThankCount .PHP_EOL.PHP_EOL;
776 922
                 if ($Member->WarnCount > 0) {
777 923
                     $msg .= "اخطارها : $Member->WarnCount \n \n ";
@@ -810,11 +956,23 @@  discard block
 block discarded – undo
810 956
         Chat::deleteMessage(Get::$chat_id, Get::$message_id);
811 957
     }
812 958
     foreach($DB->SelectData('Bot/', 'Temp') as $Temp){
813
-        if($Temp->Type == 'Welcome' && $Temp->Time + $Group->DelWlcMSGAfter < time()) Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
814
-        if($Temp->Type == 'ForceTOAddInGP' && $Temp->Time + $Group->DelForceAddMSGAfter < time()) Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
815
-        if($Temp->Type == 'ForceTOChannelJoin' && $Temp->Time + $Group->DelForceJoinMSGAfter < time()) Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
816
-        if($Temp->Type == 'Captcha' && $Temp->Time + $Group->DelCaptchaMSGAfter < time()) Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
817
-        if($Temp->Type == 'Warn' && $Temp->Time + $Group->DelWarnMSGAfter < time()) Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
818
-        if($Temp->Type == 'Report' && $Temp->Time + $Group->DelReportMSGAfter < time()) Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
959
+        if($Temp->Type == 'Welcome' && $Temp->Time + $Group->DelWlcMSGAfter < time()) {
960
+            Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
961
+        }
962
+        if($Temp->Type == 'ForceTOAddInGP' && $Temp->Time + $Group->DelForceAddMSGAfter < time()) {
963
+            Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
964
+        }
965
+        if($Temp->Type == 'ForceTOChannelJoin' && $Temp->Time + $Group->DelForceJoinMSGAfter < time()) {
966
+            Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
967
+        }
968
+        if($Temp->Type == 'Captcha' && $Temp->Time + $Group->DelCaptchaMSGAfter < time()) {
969
+            Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
970
+        }
971
+        if($Temp->Type == 'Warn' && $Temp->Time + $Group->DelWarnMSGAfter < time()) {
972
+            Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
973
+        }
974
+        if($Temp->Type == 'Report' && $Temp->Time + $Group->DelReportMSGAfter < time()) {
975
+            Chat::deleteMessage($Temp->Chat_id, $Temp->Message_id);
976
+        }
819 977
     }
820 978
 }
821 979
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
         'WhiteListChannels' => [],
135 135
         'WordsFilterList' => [],
136 136
         'MSGs' => [
137
-            'WelcomeMSG'          => ['MSG'=>' سلام -MENTION=~NEW_USER_ID~~NEW_FIRST_NAME~- ~ENTER~ به گروه ~GROUP_TITLE~ خوش آمدید. ','name'=>'پیام خوش آمدگویی'],
138
-            'ForceADDMSG'         => ['MSG'=>' سلام -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ برای ارسال پیام ابتدا ~SHOULD_ADD_NUMBER~ نفر اد کنید. ~ENTER~ تعداد اد شده توسط شما : ~ADD_NUMBER~','name'=>'پیام اد اجباری'],
139
-            'ForceChannelJoinMSG' => ['MSG'=>' سلام -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ برای ارسال پیام ابتدا عضو کانال های زیر شوید. ','name'=>'پیام عضویت اجباری'],
140
-            'CaptchaMSG'          => ['MSG'=>' سلام -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ برای ارسال پیام ابتدا حساب کاربری خود را تایید کنید. ~ENTER~ 3/~CAPTCHASENDNUM~ ','name'=>'پیام کپچا'],
141
-            'SpamReportMSG'       => ['MSG'=>' کاربر -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ تو گروه اسپم میکنه. ~ENTER~ -MENTION=~CREATOR_ID~ADMIN- ','name'=>'پیام گزارش اسپم'],
142
-            'WarnMSG'             => ['MSG'=>' کاربر -MENTION=~IN_REPLY_ID~~IN_REPLY_FIRST_NAME~- ~ENTER~ یک اخطار به اخطار های شما اضافه شد ~ENTER~ ~USERWARNCOUNT~/~WARNNUMBERTOREMOVE~ ','name'=>'پیام اخطار'],
143
-            'delWarnMSG'          => ['MSG'=>' کاربر -MENTION=~IN_REPLY_ID~~IN_REPLY_FIRST_NAME~- ~ENTER~ یک اخطار از اخطار های شما کسر شد ~ENTER~ ~USERWARNCOUNT~/~WARNNUMBERTOREMOVE~ ','name'=>'پیام حذف اخطار'],
144
-            'BotWarnMSG'          => ['MSG'=>' کاربر -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ یک اخطار به اخطار های شما اضافه شد ~ENTER~ ~USERWARNCOUNT~/~WARNNUMBERTOREMOVE~ ','name'=>'پیام اخطار اسپم'],
137
+            'WelcomeMSG'          => ['MSG'=>' سلام -MENTION=~NEW_USER_ID~~NEW_FIRST_NAME~- ~ENTER~ به گروه ~GROUP_TITLE~ خوش آمدید. ', 'name'=>'پیام خوش آمدگویی'],
138
+            'ForceADDMSG'         => ['MSG'=>' سلام -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ برای ارسال پیام ابتدا ~SHOULD_ADD_NUMBER~ نفر اد کنید. ~ENTER~ تعداد اد شده توسط شما : ~ADD_NUMBER~', 'name'=>'پیام اد اجباری'],
139
+            'ForceChannelJoinMSG' => ['MSG'=>' سلام -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ برای ارسال پیام ابتدا عضو کانال های زیر شوید. ', 'name'=>'پیام عضویت اجباری'],
140
+            'CaptchaMSG'          => ['MSG'=>' سلام -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ برای ارسال پیام ابتدا حساب کاربری خود را تایید کنید. ~ENTER~ 3/~CAPTCHASENDNUM~ ', 'name'=>'پیام کپچا'],
141
+            'SpamReportMSG'       => ['MSG'=>' کاربر -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ تو گروه اسپم میکنه. ~ENTER~ -MENTION=~CREATOR_ID~ADMIN- ', 'name'=>'پیام گزارش اسپم'],
142
+            'WarnMSG'             => ['MSG'=>' کاربر -MENTION=~IN_REPLY_ID~~IN_REPLY_FIRST_NAME~- ~ENTER~ یک اخطار به اخطار های شما اضافه شد ~ENTER~ ~USERWARNCOUNT~/~WARNNUMBERTOREMOVE~ ', 'name'=>'پیام اخطار'],
143
+            'delWarnMSG'          => ['MSG'=>' کاربر -MENTION=~IN_REPLY_ID~~IN_REPLY_FIRST_NAME~- ~ENTER~ یک اخطار از اخطار های شما کسر شد ~ENTER~ ~USERWARNCOUNT~/~WARNNUMBERTOREMOVE~ ', 'name'=>'پیام حذف اخطار'],
144
+            'BotWarnMSG'          => ['MSG'=>' کاربر -MENTION=~USER_ID~~FIRST_NAME~- ~ENTER~ یک اخطار به اخطار های شما اضافه شد ~ENTER~ ~USERWARNCOUNT~/~WARNNUMBERTOREMOVE~ ', 'name'=>'پیام اخطار اسپم'],
145 145
         ],
146 146
         'DelWlcMSGAfter' => 5,
147 147
         'DelForceAddMSGAfter' => 5,
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
         $Member = $DB->SelectData('Groups/' . Get::$chat_id . '/Users', $user_id, ['User_id' => $user_id]);
204 204
     }
205 205
     if (!in_array($user_id, $sudors) && $user_id != $Group->Creator && !in_array($user_id, $Group->Administrators) && !in_array($user_id, $Group->WhiteListUsers)) {
206
-        foreach($Group->MSGs as $key => $value){
206
+        foreach ($Group->MSGs as $key => $value) {
207 207
             $text = $value->MSG;
208
-            if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
208
+            if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/', "<a href='tg://user?id=$1'>$2</a>", $text);
209 209
             if (strpos($text, '~USER_ID~')) $text = str_replace('~USER_ID~', Get::$from_id, $text);
210 210
             if (strpos($text, '~FIRST_NAME~')) $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
211 211
             if (strpos($text, '~LAST_NAME~')) $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             if ($Group->Settings->WelcomeMSGStatus->Value) {
240 240
                 $msg = $Group->MSGs->WelcomeMSG->MSG;
241 241
                 if ($Group->Settings->CaptchaStatus->Value && !$User->CaptchaStatus) {
242
-                    $msg .= PHP_EOL.PHP_EOL.'برای فعالیت در گروه ابتدا حساب خود را تایید کنید.';
242
+                    $msg .= PHP_EOL . PHP_EOL . 'برای فعالیت در گروه ابتدا حساب خود را تایید کنید.';
243 243
                     $markup = Send::InlineKeyboardMarkup([
244 244
                             [
245 245
                                 ['text' => 'من ربات نیستم', 'callback_data' => "/captchaVerify_$user_id"]
@@ -247,14 +247,14 @@  discard block
 block discarded – undo
247 247
                         ]);
248 248
                     $send_return = Send::sendMessage(Get::$chat_id, $msg, 'HTML', false, false, null, $markup);
249 249
                     $DB->UpdateData('Users', $user_id, ['CaptchaSendNum' => ++$User->CaptchaSendNum], ['User_id' => $user_id]);
250
-                    $DB->InsertData('Bot', 'Temp', ['Type'=>'Captcha','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
250
+                    $DB->InsertData('Bot', 'Temp', ['Type'=>'Captcha', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
251 251
                 } else {
252 252
                     $send_return = Send::sendMessage(Get::$chat_id, $msg, 'HTML');
253
-                    $DB->InsertData('Bot', 'Temp', ['Type'=>'Welcome','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
253
+                    $DB->InsertData('Bot', 'Temp', ['Type'=>'Welcome', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
254 254
                 }
255 255
             } elseif ($Group->Settings->CaptchaStatus->Value && !$User->CaptchaStatus) {
256 256
                 $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->CaptchaMSG->MSG, 'HTML');
257
-                $DB->InsertData('Bot', 'Temp', ['Type'=>'Captcha','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
257
+                $DB->InsertData('Bot', 'Temp', ['Type'=>'Captcha', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
258 258
             }
259 259
         } elseif (!Get::$new_chat_member_id && !Get::$left_chat_member_id && strpos(Get::$callback_query_data ?? 'Null', '/captchaVerify_') === false) {
260 260
             if ($Group->Settings->CaptchaStatus->Value && !$User->CaptchaStatus) {
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                     ]);
268 268
                     $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->CaptchaMSG->MSG, 'HTML', false, false, null, $markup);
269 269
                     $DB->UpdateData('Users', $user_id, ['CaptchaSendNum' => ++$User->CaptchaSendNum], ['User_id' => $user_id]);
270
-                    $DB->InsertData('Bot', 'Temp', ['Type'=>'Captcha','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
270
+                    $DB->InsertData('Bot', 'Temp', ['Type'=>'Captcha', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
271 271
                 } else {
272 272
                     $DB->InsertData('Users/BlackDir', 'ClintBotList', ['User_id' => $user_id, 'Time' => time()]);
273 273
                     Chat::kickChatMember(Get::$chat_id, $user_id);
@@ -276,41 +276,41 @@  discard block
 block discarded – undo
276 276
             } elseif ($Group->Settings->ForceTOAddInGP->Value && $Group->AddNumber > $Member->AddNumber) {
277 277
                 Chat::deleteMessage(Get::$chat_id, Get::$message_id);
278 278
                 $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->ForceADDMSG->MSG, 'HTML');
279
-                $DB->InsertData('Bot', 'Temp', ['Type'=>'ForceTOAddInGP','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
279
+                $DB->InsertData('Bot', 'Temp', ['Type'=>'ForceTOAddInGP', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
280 280
                 die();
281 281
             } elseif ($Group->Settings->DelLinkStatus->Value && in_array('url', array_column(Get::$entities, 'type'))) {
282 282
                 Chat::deleteMessage(Get::$chat_id, Get::$message_id);
283 283
                 die();
284
-            } elseif ($Group->Settings->DelTGLinkStatus->Value && (strpos('t.me',Get::$text ?? Get::$caption) || strpos('telegram.me',Get::$text ?? Get::$caption) || strpos('telegram.dog',Get::$text ?? Get::$caption))) {
284
+            } elseif ($Group->Settings->DelTGLinkStatus->Value && (strpos('t.me', Get::$text ?? Get::$caption) || strpos('telegram.me', Get::$text ?? Get::$caption) || strpos('telegram.dog', Get::$text ?? Get::$caption))) {
285 285
                 Chat::deleteMessage(Get::$chat_id, Get::$message_id);
286 286
                 die();
287 287
             } elseif ($Group->Settings->DelMentionStatus->Value && in_array('mention', array_column(Get::$entities, 'type'))) {
288 288
                 Chat::deleteMessage(Get::$chat_id, Get::$message_id);
289 289
                 die();
290
-            } elseif ($Group->Settings->DelForwardStatus->Value && Get::$forward_from_chat_type == 'channel' && !in_array(Get::$forward_from_chat_username,$Group->WhiteListChannels)) {
290
+            } elseif ($Group->Settings->DelForwardStatus->Value && Get::$forward_from_chat_type == 'channel' && !in_array(Get::$forward_from_chat_username, $Group->WhiteListChannels)) {
291 291
                 Chat::deleteMessage(Get::$chat_id, Get::$message_id);
292 292
                 die();
293 293
             } elseif ($Group->Settings->ForceTOChannelJoin->Value) {
294
-                $Channels="\n\n";
294
+                $Channels = "\n\n";
295 295
                 $NotJoin = false;
296 296
                 foreach ($Group->GPChannels as $Channel) {
297
-                    $res = Chat::getChatMember('@'.$Channel, $user_id);
297
+                    $res = Chat::getChatMember('@' . $Channel, $user_id);
298 298
                     if ($res->ok) {
299 299
                         if ($res->result->status == 'left' || $res->result->status == 'kicked') {
300 300
                             $NotJoin = true;
301
-                            $Channels .="@".$Channel."\n";
301
+                            $Channels .= "@" . $Channel . "\n";
302 302
                         }
303 303
                     }
304 304
                 }
305 305
                 if ($NotJoin) {
306 306
                     Chat::deleteMessage(Get::$chat_id, Get::$message_id);
307
-                    $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->ForceChannelJoinMSG->MSG.$Channels, 'HTML');
308
-                    $DB->InsertData('Bot', 'Temp', ['Type'=>'ForceTOChannelJoin','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
307
+                    $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->ForceChannelJoinMSG->MSG . $Channels, 'HTML');
308
+                    $DB->InsertData('Bot', 'Temp', ['Type'=>'ForceTOChannelJoin', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
309 309
                 }
310 310
             }
311
-            if ($Group->Settings->DelFilterWordsStatus->Value ) {
312
-                foreach($Group->WordsFilterList as $word){
313
-                    if(preg_match("~$word~i", Get::$text)){
311
+            if ($Group->Settings->DelFilterWordsStatus->Value) {
312
+                foreach ($Group->WordsFilterList as $word) {
313
+                    if (preg_match("~$word~i", Get::$text)) {
314 314
                         Chat::deleteMessage(Get::$chat_id, Get::$message_id);
315 315
                         die();
316 316
                     }
@@ -325,17 +325,17 @@  discard block
 block discarded – undo
325 325
                             Chat::kickChatMember(Get::$chat_id, $user_id);
326 326
                         }
327 327
                         $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->BotWarnMSG->MSG, 'HTML');
328
-                        $DB->InsertData('Bot', 'Temp', ['Type'=>'Warn','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
328
+                        $DB->InsertData('Bot', 'Temp', ['Type'=>'Warn', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
329 329
                     }
330 330
                     if ($Group->Settings->SpamReportStatus->Value) {
331 331
                         $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->SpamReportMSG->MSG, 'HTML');
332
-                        $DB->InsertData('Bot', 'Temp', ['Type'=>'Report','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
332
+                        $DB->InsertData('Bot', 'Temp', ['Type'=>'Report', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
333 333
                     }
334
-                    $DB->UpdateData('Groups/' . Get::$chat_id . '/Users', $user_id, ['SpamCount' => 0,'SSCU' => time()], ['User_id' => $user_id]);
335
-                    $res = Chat::restrictChatMember(Get::$chat_id, $user_id, ['can_send_messages' => false], 10*60);
334
+                    $DB->UpdateData('Groups/' . Get::$chat_id . '/Users', $user_id, ['SpamCount' => 0, 'SSCU' => time()], ['User_id' => $user_id]);
335
+                    $res = Chat::restrictChatMember(Get::$chat_id, $user_id, ['can_send_messages' => false], 10 * 60);
336 336
                     die();
337 337
                 } elseif (($Member->SSCU + $Group->SpamTimeToReport) < time()) {
338
-                    $DB->UpdateData('Groups/' . Get::$chat_id . '/Users', $user_id, ['SpamCount' => 0,'SSCU' => time()], ['User_id' => $user_id]);
338
+                    $DB->UpdateData('Groups/' . Get::$chat_id . '/Users', $user_id, ['SpamCount' => 0, 'SSCU' => time()], ['User_id' => $user_id]);
339 339
                 }
340 340
             }
341 341
         }
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                         if ($res->ok) {
355 355
                             Send::sendMessage(Get::$chat_id, 'کاربر به لیست سیاه اضافه و از گروه ریمو شد', null, false, false, Get::$message_id);
356 356
                         } else {
357
-                            Send::sendMessage(Get::$chat_id, 'کاربر به لیست سیاه اضافه شد اما به علت :'.PHP_EOL.$res->description.PHP_EOL.'از گروه ریمو نشد', null, false, false, Get::$message_id);
357
+                            Send::sendMessage(Get::$chat_id, 'کاربر به لیست سیاه اضافه شد اما به علت :' . PHP_EOL . $res->description . PHP_EOL . 'از گروه ریمو نشد', null, false, false, Get::$message_id);
358 358
                         }
359 359
                     } else {
360 360
                         Send::sendMessage(Get::$chat_id, 'کاربر از قبل در لیست سیاه وجود داشت', null, false, false, Get::$message_id);
@@ -385,9 +385,9 @@  discard block
 block discarded – undo
385 385
             } elseif (Get::$text == 'اخطار') {
386 386
                 if (Get::$reply_to_from_id != ($id = explode(':', getenv('TOKEN'))[0]) && !in_array(Get::$reply_to_from_id, $sudors) && !in_array(Get::$reply_to_from_id, $Group->Administrators)) {
387 387
                     $Member = $DB->SelectData('Groups/' . Get::$chat_id . '/Users', Get::$reply_to_from_id, ['User_id' => Get::$reply_to_from_id]);
388
-                    $Member->WarnCount = $Member->WarnCount +1;
388
+                    $Member->WarnCount = $Member->WarnCount + 1;
389 389
                     $text = $Group->MSGs->WarnMSG->MSG;
390
-                    if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
390
+                    if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/', "<a href='tg://user?id=$1'>$2</a>", $text);
391 391
                     if (strpos($text, '~USER_ID~')) $text = str_replace('~USER_ID~', Get::$from_id, $text);
392 392
                     if (strpos($text, '~FIRST_NAME~')) $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
393 393
                     if (strpos($text, '~LAST_NAME~')) $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
@@ -420,15 +420,15 @@  discard block
 block discarded – undo
420 420
                         Chat::kickChatMember(Get::$chat_id, Get::$reply_to_from_id);
421 421
                     }
422 422
                     $send_return = Send::sendMessage(Get::$chat_id, $text, 'HTML');
423
-                    $DB->InsertData('Bot', 'Temp', ['Type'=>'Warn','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
423
+                    $DB->InsertData('Bot', 'Temp', ['Type'=>'Warn', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
424 424
                 } else {
425 425
                     Send::sendMessage(Get::$chat_id, 'امکان محدود سازی ادمین وجود ندارد!', null, false, false, Get::$message_id);
426 426
                 }
427 427
             } elseif (Get::$text == 'حذف اخطار') {
428 428
                 $Member = $DB->SelectData('Groups/' . Get::$chat_id . '/Users', Get::$reply_to_from_id, ['User_id' => Get::$reply_to_from_id]);
429
-                    $Member->WarnCount = $Member->WarnCount -1;
429
+                    $Member->WarnCount = $Member->WarnCount - 1;
430 430
                     $text = $Group->MSGs->WarnMSG->MSG;
431
-                    if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/',"<a href='tg://user?id=$1'>$2</a>",$text);
431
+                    if (strpos($text, '-MENTION')) $text = preg_replace('/-MENTION=(~.*?~)(.*?)-/', "<a href='tg://user?id=$1'>$2</a>", $text);
432 432
                     if (strpos($text, '~USER_ID~')) $text = str_replace('~USER_ID~', Get::$from_id, $text);
433 433
                     if (strpos($text, '~FIRST_NAME~')) $text = str_replace('~FIRST_NAME~', Get::$from_first_name, $text);
434 434
                     if (strpos($text, '~LAST_NAME~')) $text = str_replace('~LAST_NAME~', Get::$from_last_name, $text);
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                     if (strpos($text, '~SHOULD_ADD_NUMBER~')) $text = str_replace('~SHOULD_ADD_NUMBER~', $Group->AddNumber, $text);
459 459
                 $DB->UpdateData('Groups/' . Get::$chat_id . '/Users', Get::$reply_to_from_id, ['WarnCount' => $Member->WarnCount], ['User_id' =>  Get::$reply_to_from_id]);
460 460
                 $send_return = Send::sendMessage(Get::$chat_id, $Group->MSGs->delWarnMSG->MSG, 'HTML');
461
-                $DB->InsertData('Bot', 'Temp', ['Type'=>'Warn','Time' => time(),'Message_id' => $send_return->result->message_id,'Chat_id' => Get::$chat_id]);
461
+                $DB->InsertData('Bot', 'Temp', ['Type'=>'Warn', 'Time' => time(), 'Message_id' => $send_return->result->message_id, 'Chat_id' => Get::$chat_id]);
462 462
             } elseif (Get::$text == 'افزودن به لیست سفید') {
463 463
                 if (!in_array(Get::$reply_to_from_id, $Group->WhiteListUsers)) {
464 464
                     $Group->WhiteListUsers[] = Get::$reply_to_from_id;
@@ -482,18 +482,18 @@  discard block
 block discarded – undo
482 482
                     if ($res->ok) {
483 483
                         Send::sendMessage(Get::$chat_id, 'کاربر ریمو شد', null, false, false, Get::$message_id);
484 484
                     } else {
485
-                        Send::sendMessage(Get::$chat_id, 'کاربر به علت :'.PHP_EOL.$res->description.PHP_EOL.'ریمو نشد', null, false, false, Get::$message_id);
485
+                        Send::sendMessage(Get::$chat_id, 'کاربر به علت :' . PHP_EOL . $res->description . PHP_EOL . 'ریمو نشد', null, false, false, Get::$message_id);
486 486
                     }
487 487
                 } else {
488 488
                     Send::sendMessage(Get::$chat_id, 'امکان ریمو کردن ادمین وجود ندارد!', null, false, false, Get::$message_id);
489 489
                 }
490 490
             } elseif (preg_match('~^سکوت ([0-9]*)$~', Get::$text, $match)) {
491 491
                 if (Get::$reply_to_from_id != ($id = explode(':', getenv('TOKEN'))[0]) && !in_array(Get::$reply_to_from_id, $sudors)) {
492
-                    $res = Chat::restrictChatMember(Get::$chat_id, Get::$reply_to_from_id, ['can_send_messages' => false], $match[1]*60);
492
+                    $res = Chat::restrictChatMember(Get::$chat_id, Get::$reply_to_from_id, ['can_send_messages' => false], $match[1] * 60);
493 493
                     if ($res->ok) {
494 494
                         Send::sendMessage(Get::$chat_id, 'کاربر به مدت ' . $match[1] . ' دقیقه محدود شد', null, false, false, Get::$message_id);
495 495
                     } else {
496
-                        Send::sendMessage(Get::$chat_id, 'کاربر به علت :'.PHP_EOL.$res->description.PHP_EOL.'محدود نشد', null, false, false, Get::$message_id);
496
+                        Send::sendMessage(Get::$chat_id, 'کاربر به علت :' . PHP_EOL . $res->description . PHP_EOL . 'محدود نشد', null, false, false, Get::$message_id);
497 497
                     }
498 498
                 } else {
499 499
                     Send::sendMessage(Get::$chat_id, 'امکان محدود سازی ادمین وجود ندارد!', null, false, false, Get::$message_id);
@@ -503,17 +503,17 @@  discard block
 block discarded – undo
503 503
             if ((in_array($user_id, $sudors) || $user_id == $Group->Creator) && Get::$text == 'لیست ادمین ها') {
504 504
                 $msg = 'لیست ادمین های گروه';
505 505
                 foreach ($Group->Administrators as $admin) {
506
-                    $msg .= PHP_EOL."<a href='tg://user?id=$admin'>$admin</a>";
506
+                    $msg .= PHP_EOL . "<a href='tg://user?id=$admin'>$admin</a>";
507 507
                 }
508 508
                 Send::sendMessage(Get::$chat_id, $msg, 'HTML', false, false, null);
509 509
             } elseif (Get::$text == 'لیست سفید') {
510
-                $msg = '<strong>'.'لیست سفید کاربران'.' : </strong>';
510
+                $msg = '<strong>' . 'لیست سفید کاربران' . ' : </strong>';
511 511
                 foreach ($Group->WhiteListUsers as $WhiteListUser) {
512
-                    $msg .= PHP_EOL."<a href='tg://user?id=$WhiteListUser'>$WhiteListUser</a>";
512
+                    $msg .= PHP_EOL . "<a href='tg://user?id=$WhiteListUser'>$WhiteListUser</a>";
513 513
                 }
514
-                $msg .= PHP_EOL.PHP_EOL.'<strong>'.'لیست سفید کانال ها'.' : </strong>';
514
+                $msg .= PHP_EOL . PHP_EOL . '<strong>' . 'لیست سفید کانال ها' . ' : </strong>';
515 515
                 foreach ($Group->WhiteListChannels as $WhiteListChannel) {
516
-                    $msg .= PHP_EOL.'@'.$WhiteListChannel;
516
+                    $msg .= PHP_EOL . '@' . $WhiteListChannel;
517 517
                 }
518 518
                 Send::sendMessage(Get::$chat_id, $msg, 'HTML', false, false, null);
519 519
             } elseif (Get::$text == 'قفل کردن گروه') {
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
                         'can_invite_users' => true,
532 532
                     ];
533 533
                 Chat::setChatPermissions(Get::$chat_id, $permission);
534
-            } elseif (Get::$text == 'تنظیمات'|| strpos(Get::$callback_query_data ?? 'Null', '/disableProperty_') !== false || strpos(Get::$callback_query_data ?? 'Null', '/enableProperty_') !== false) {
534
+            } elseif (Get::$text == 'تنظیمات' || strpos(Get::$callback_query_data ?? 'Null', '/disableProperty_') !== false || strpos(Get::$callback_query_data ?? 'Null', '/enableProperty_') !== false) {
535 535
                 if (strpos(Get::$callback_query_data ?? 'Null', '/disableProperty_') !== false) {
536 536
                     $Property = str_replace('/disableProperty_', '', Get::$callback_query_data);
537 537
                     $Group->Settings->$Property->Value = false;
@@ -562,19 +562,19 @@  discard block
 block discarded – undo
562 562
             } elseif (Get::$text == 'لیست پیام ها') {
563 563
                 $msg = 'پیام ها :';
564 564
                 foreach ($Group->MSGs as $MSG) {
565
-                    $msg .= PHP_EOL.PHP_EOL.'<strong>'.$MSG->name.' : </strong>'.PHP_EOL.$MSG->MSG;
565
+                    $msg .= PHP_EOL . PHP_EOL . '<strong>' . $MSG->name . ' : </strong>' . PHP_EOL . $MSG->MSG;
566 566
                 }
567 567
                 Send::sendMessage(Get::$chat_id, $msg, 'HTML', false, false, null);
568 568
             } elseif (Get::$text == 'لیست کانال ها') {
569 569
                 $msg = 'کانال ها :';
570 570
                 foreach ($Group->GPChannels as $GPChannel) {
571
-                    $msg .= PHP_EOL.'@'.$GPChannel;
571
+                    $msg .= PHP_EOL . '@' . $GPChannel;
572 572
                 }
573 573
                 Send::sendMessage(Get::$chat_id, $msg, 'HTML', false, false, null);
574 574
             } elseif (Get::$text == 'لیست فیلتر') {
575 575
                 $msg = 'کلمات فیلتر شده :';
576 576
                 foreach ($Group->WordsFilterList as $Words) {
577
-                    $msg .= PHP_EOL.$Words;
577
+                    $msg .= PHP_EOL . $Words;
578 578
                 }
579 579
                 Send::sendMessage(Get::$chat_id, $msg, 'HTML', false, false, null);
580 580
             } elseif (preg_match('~^افزودن به لیست سفید (.*)$~', Get::$text, $match)) {
@@ -720,39 +720,39 @@  discard block
 block discarded – undo
720 720
         }
721 721
     }
722 722
     $DB->UpdateData('Users/', $user_id, ['MSGCount' => ++$User->MSGCount], ['User_id' => $user_id]);
723
-    if (Get::$reply_to_from_id){
724
-        if (Get::$text == 'ممنون' || Get::$text == 'خیلی ممنون' || Get::$text == 'متشکر' || Get::$text == 'تشکر' || Get::$text == 'دمت گرم' || Get::$text == 'دمتون گرم' || Get::$text == 'لطف کردین' || Get::$text == 'مچکر' || Get::$text == 'خیلی ممنونم' || Get::$text == 'ممنونم' || Get::$text == 'متشکرم'){
725
-            if ($User->LTU + 60*10 < time() && Get::$reply_to_from_id != Get::$from_id) {
723
+    if (Get::$reply_to_from_id) {
724
+        if (Get::$text == 'ممنون' || Get::$text == 'خیلی ممنون' || Get::$text == 'متشکر' || Get::$text == 'تشکر' || Get::$text == 'دمت گرم' || Get::$text == 'دمتون گرم' || Get::$text == 'لطف کردین' || Get::$text == 'مچکر' || Get::$text == 'خیلی ممنونم' || Get::$text == 'ممنونم' || Get::$text == 'متشکرم') {
725
+            if ($User->LTU + 60 * 10 < time() && Get::$reply_to_from_id != Get::$from_id) {
726 726
                 $User = $DB->SelectData('Users', Get::$reply_to_from_id, ['User_id' => Get::$reply_to_from_id]);
727
-                $DB->UpdateData('Users/' , Get::$reply_to_from_id, ['ThankCount' => ++$User->ThankCount], ['User_id' => Get::$reply_to_from_id]);
727
+                $DB->UpdateData('Users/', Get::$reply_to_from_id, ['ThankCount' => ++$User->ThankCount], ['User_id' => Get::$reply_to_from_id]);
728 728
             }
729 729
         } elseif ((Get::$text == 'فارسی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
730 730
             $msg = GoogleTranslate::translate('auto', 'fa', $text);
731
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
731
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
732 732
         } elseif ((Get::$text == 'انگلیسی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
733 733
             $msg = GoogleTranslate::translate('auto', 'en', $text);
734
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
734
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
735 735
         } elseif ((Get::$text == 'ایتالیایی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
736 736
             $msg = GoogleTranslate::translate('auto', 'it', $text);
737
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
737
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
738 738
         } elseif ((Get::$text == 'فرانسوی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
739 739
             $msg = GoogleTranslate::translate('auto', 'fr', $text);
740
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
740
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
741 741
         } elseif ((Get::$text == 'آلمانی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
742 742
             $msg = GoogleTranslate::translate('auto', 'de', $text);
743
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
743
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
744 744
         } elseif ((Get::$text == 'ترکی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
745 745
             $msg = GoogleTranslate::translate('auto', 'tr', $text);
746
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
746
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
747 747
         } elseif ((Get::$text == 'عربی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
748 748
             $msg = GoogleTranslate::translate('auto', 'ar', $text);
749
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
749
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
750 750
         } elseif ((Get::$text == 'ژاپنی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
751 751
             $msg = GoogleTranslate::translate('auto', 'ja', $text);
752
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
752
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
753 753
         } elseif ((Get::$text == 'چینی') && ($text = Get::$reply_to_text ?? Get::$reply_to_caption) && isset($text)) {
754 754
             $msg = GoogleTranslate::translate('auto', 'zh', $text);
755
-            Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
755
+            Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
756 756
         }
757 757
     } else {
758 758
         if ($Group->Settings->InfoMSGStatus->Value && (preg_match('~^(ربات)? ?من$~', Get::$text) || preg_match('~^me$~i', Get::$text) || preg_match('~^info$~i', Get::$text))) {
@@ -770,17 +770,17 @@  discard block
 block discarded – undo
770 770
                     $Position = '⭐';
771 771
                 }
772 772
                 $photo = end($UserInfo->result->photos[0])->file_id;
773
-                $msg = 'نام : '.Get::$from_first_name.' '.Get::$from_last_name;
774
-                if(Get::$from_username) $msg .="\n\n نام کاربری : ".Get::$from_username;
775
-                $msg .="\n\n یوزر آیدی : ".Get::$from_id."\n\n تعداد پیام های ارسالی در گروه‌ها : ".$User->MSGCount."\n\n تعداد تشکر ها : ".$User->ThankCount .PHP_EOL.PHP_EOL;
773
+                $msg = 'نام : ' . Get::$from_first_name . ' ' . Get::$from_last_name;
774
+                if (Get::$from_username) $msg .= "\n\n نام کاربری : " . Get::$from_username;
775
+                $msg .= "\n\n یوزر آیدی : " . Get::$from_id . "\n\n تعداد پیام های ارسالی در گروه‌ها : " . $User->MSGCount . "\n\n تعداد تشکر ها : " . $User->ThankCount . PHP_EOL . PHP_EOL;
776 776
                 if ($Member->WarnCount > 0) {
777 777
                     $msg .= "اخطارها : $Member->WarnCount \n \n ";
778 778
                 }
779 779
                 $msg .= "رتبه : $Position";
780 780
                 if ($photo) {
781
-                    Send::sendPhoto(Get::$chat_id , $photo , $msg ,null , false , Get::$message_id);
781
+                    Send::sendPhoto(Get::$chat_id, $photo, $msg, null, false, Get::$message_id);
782 782
                 } else {
783
-                    Send::sendMessage(Get::$chat_id , $msg ,null , false ,false, Get::$message_id);
783
+                    Send::sendMessage(Get::$chat_id, $msg, null, false, false, Get::$message_id);
784 784
                 }
785 785
             }
786 786
         } elseif (preg_match('~ساعت ?چن?د?ه?~', Get::$text)) {
@@ -795,26 +795,26 @@  discard block
 block discarded – undo
795 795
                 Chat::deleteMessage(Get::$chat_id, Get::$message_id);
796 796
                 $DB->UpdateData('Users', $user_id, ['CaptchaStatus' => true], ['User_id' => $user_id]);
797 797
             }
798
-        } elseif ($Group->Settings->ConversationStatus->Value && in_array(Get::$text, array_keys(get_object_vars($words = $DB->SelectData('Bot','Words'))))) {
798
+        } elseif ($Group->Settings->ConversationStatus->Value && in_array(Get::$text, array_keys(get_object_vars($words = $DB->SelectData('Bot', 'Words'))))) {
799 799
             $text = Get::$text;
800
-            $msg = "اینم ".Get::$text." برای شما 
Please login to merge, or discard this patch.
src/Bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
         $envPathExample = $envPath . '.example';
11 11
 
12 12
         if (!is_file($envPath) || filesize($envPath) === 0) {
13
-            copy($envPathExample,$envPath);
13
+            copy($envPathExample, $envPath);
14 14
         }
15 15
         require_once $envPath;
16 16
         if (getenv('VERSION') !== ENV_VERSION) {
Please login to merge, or discard this patch.
src/DB/DB.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     public static function Database()
19 19
     {
20 20
         $DB = getenv('DB');
21
-        if     ($DB == 'json') self::$instance = new Json();
21
+        if ($DB == 'json') self::$instance = new Json();
22 22
         elseif ($DB == 'mysql') self::$instance = new Mysql();
23 23
         elseif ($DB == 'mongodb') self::$instance = new MongoDB();
24 24
         return self::$instance;
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,13 @@
 block discarded – undo
18 18
     public static function Database()
19 19
     {
20 20
         $DB = getenv('DB');
21
-        if     ($DB == 'json') self::$instance = new Json();
22
-        elseif ($DB == 'mysql') self::$instance = new Mysql();
23
-        elseif ($DB == 'mongodb') self::$instance = new MongoDB();
21
+        if     ($DB == 'json') {
22
+            self::$instance = new Json();
23
+        } elseif ($DB == 'mysql') {
24
+            self::$instance = new Mysql();
25
+        } elseif ($DB == 'mongodb') {
26
+            self::$instance = new MongoDB();
27
+        }
24 28
         return self::$instance;
25 29
 
26 30
     }
Please login to merge, or discard this patch.
src/DB/Json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
         $fileName = $this->DBDir . '/' . $DBName . '/' . $TableName . '.json';
138 138
         if (is_file($fileName)) {
139 139
             $out = json_decode(file_get_contents($fileName));
140
-            $i=-1;
140
+            $i = -1;
141 141
             foreach ($out as $item) {
142 142
                 $i++;
143 143
                 $res = true;
Please login to merge, or discard this patch.
src/Get.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,21 +96,21 @@
 block discarded – undo
96 96
                 self::$reply_to_from_language_code = $input->$type->reply_to_message->from->language_code ?? null;
97 97
                 self::$reply_to_text = $input->$type->reply_to_message->text ?? null;
98 98
                 self::$reply_to_caption = $input->$type->reply_to_message->caption ?? null;
99
-            } elseif(isset($input->message->new_chat_member)){
99
+            } elseif (isset($input->message->new_chat_member)) {
100 100
                 self::$new_chat_member_id = $input->message->new_chat_member->id;
101 101
                 self::$new_chat_member_is_bot = $input->message->new_chat_member->is_bot;
102 102
                 self::$new_chat_member_first_name = $input->message->new_chat_member->first_name ?? null;
103 103
                 self::$new_chat_member_last_name = $input->message->new_chat_member->last_name ?? null;
104 104
                 self::$new_chat_member_username = $input->message->new_chat_member->username ?? null;
105 105
                 self::$new_chat_member_language_code = $input->message->new_chat_member->language_code ?? null;
106
-            } elseif(isset($input->message->forward_from_chat)){
106
+            } elseif (isset($input->message->forward_from_chat)) {
107 107
                 self::$forward_from_chat_id = $input->message->forward_from_chat->id;
108 108
                 self::$forward_from_chat_type = $input->message->forward_from_chat->type;
109 109
                 self::$forward_from_chat_title = $input->message->forward_from_chat->title;
110 110
                 self::$forward_from_chat_username = $input->message->forward_from_chat->username ?? null;
111
-            } elseif(isset($input->message->new_chat_photo)){
111
+            } elseif (isset($input->message->new_chat_photo)) {
112 112
                 self::$new_chat_photo_file_id = $input->message->new_chat_photo->file_id;
113
-            } elseif(isset($input->message->new_chat_title)){
113
+            } elseif (isset($input->message->new_chat_title)) {
114 114
                 self::$new_chat_title = $input->message->new_chat_title;
115 115
             }
116 116
         } elseif (isset($input->callback_query)) {
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,11 @@
 block discarded – undo
65 65
     public static function set($input)
66 66
     {
67 67
         if (isset($input->message) || isset($input->edited_message)) {
68
-            if (isset($input->message)) $type = 'message';
69
-            else $type = 'edited_message';
68
+            if (isset($input->message)) {
69
+                $type = 'message';
70
+            } else {
71
+                $type = 'edited_message';
72
+            }
70 73
             //
71 74
             self::$message_id = $input->$type->message_id;
72 75
             //
Please login to merge, or discard this patch.
src/jdf.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@
 block discarded – undo
332 332
  */
333 333
 function gregorian_to_jalali($gy, $gm, $gd, $mod = '')
334 334
 {
335
-    list($gy, $gm, $gd) = explode('_', tr_num($gy . '_' . $gm . '_' . $gd));/* <= Extra :اين سطر ، جزء تابع اصلي نيست */
335
+    list($gy, $gm, $gd) = explode('_', tr_num($gy . '_' . $gm . '_' . $gd)); /* <= Extra :اين سطر ، جزء تابع اصلي نيست */
336 336
     $g_d_m = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
337 337
     if ($gy > 1600) {
338 338
         $jy = 979;
Please login to merge, or discard this patch.