Passed
Push — master ( c4ef1a...0291a9 )
by Behzad
01:28
created
group.php 1 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
 }
Please login to merge, or discard this patch.