Passed
Push — master ( c4ef1a...0291a9 )
by Behzad
01:28
created
group.php 1 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.