@@ -520,7 +520,7 @@ |
||
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); |
@@ -134,14 +134,14 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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." برای شما |
@@ -205,34 +205,82 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |