Upload index.php
Browse files
index.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
if(file_exists('oghab.madeline') && file_exists('update-session/oghab.madeline') && (time() - filectime('oghab.madeline')) > 90){
|
1 |
unlink('oghab.madeline.lock');
|
2 |
unlink('oghab.madeline');
|
3 |
unlink('madeline.phar');
|
4 |
unlink('madeline.phar.version');
|
5 |
unlink('madeline.php');
|
6 |
unlink('MadelineProto.log');
|
7 |
unlink('bot.lock');
|
8 |
copy('update-session/oghab.madeline', 'oghab.madeline');
|
9 |
}
|
10 |
if(file_exists('oghab.madeline') && file_exists('update-session/oghab.madeline') && (filesize('oghab.madeline')/1024) > 10240){
|
11 |
unlink('oghab.madeline.lock');
|
12 |
unlink('oghab.madeline');
|
13 |
unlink('madeline.phar');
|
14 |
unlink('madeline.phar.version');
|
15 |
unlink('madeline.php');
|
16 |
unlink('bot.lock');
|
17 |
unlink('MadelineProto.log');
|
18 |
copy('update-session/oghab.madeline', 'oghab.madeline');
|
19 |
}
|
20 |
if (php_sapi_name() === 'cli' || isset($GLOBALS['exited'])) {
|
21 |
return;
|
22 |
}
|
23 |
@ob_end_clean();
|
24 |
@header('Connection: close');
|
25 |
ignore_user_abort(true);
|
26 |
ob_start();
|
27 |
echo "$message";
|
28 |
$size = ob_get_length();
|
29 |
@header("Content-Length: $size");
|
30 |
@header('Content-Type: text/html');
|
31 |
ob_end_flush();
|
32 |
flush();
|
33 |
$GLOBALS['exited'] = true;
|
34 |
try {
|
35 |
$a = fsockopen((isset($_SERVER['HTTPS']) && @$_SERVER['HTTPS'] ? 'tls' : 'tcp').'://'.@$_SERVER['SERVER_NAME'], @$_SERVER['SERVER_PORT']);
|
36 |
fwrite($a, @$_SERVER['REQUEST_METHOD'].' '.@$_SERVER['REQUEST_URI'].' '.@$_SERVER['SERVER_PROTOCOL']."\r\n".'Host: '.@$_SERVER['SERVER_NAME']."\r\n\r\n");
|
37 |
flock($lock, LOCK_UN);
|
38 |
fclose($lock);
|
39 |
touch('bot.lock');
|
40 |
$locked = flock($lock, LOCK_EX | LOCK_NB);
|
41 |
if (!$locked) {
|
42 |
closeConnection();
|
43 |
if ($try++ >= 30) {
|
44 |
exit;
|
45 |
}
|
46 |
sleep(1);
|
47 |
}
|
48 |
file_put_contents('data.json','{"autochat":{"on":"on"},"admins":{}}');
|
49 |
mkdir('update-session');
|
50 |
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
|
51 |
yield $this->onUpdateNewMessage($update);
|
52 |
yield $this->onUpdateNewMessage($update);
|
53 |
try {
|
54 |
if(!file_exists('update-session/oghab.madeline')){
|
55 |
copy('oghab.madeline', 'update-session/oghab.madeline');
|
56 |
}
|
57 |
// Oghab_Tm
|
58 |
$userID = isset($update['message']['from_id']) ? $update['message']['from_id']:'';
|
59 |
$msg = isset($update['message']['message']) ? $update['message']['message']:'';
|
60 |
$msg_id = isset($update['message']['id']) ? $update['message']['id']:'';
|
61 |
$MadelineProto = $this;
|
62 |
$me = yield $MadelineProto->get_self();
|
63 |
$me_id = $me['id'];
|
64 |
$info = yield $MadelineProto->get_info($update);
|
65 |
$chatID = $info['bot_api_id'];
|
66 |
$type2 = $info['type'];
|
67 |
@$data = json_decode(file_get_contents("data.json"), true);
|
68 |
$creator = 5682758308; // ایدی عددی ران کننده ربات
|
69 |
$admin = 5241675360; // ایدی عددی ادمین اصلی
|
70 |
if(file_exists('oghab.madeline') && filesize('oghab.madeline')/1024 > 6143){
|
71 |
unlink('oghab.madeline.lock');
|
72 |
unlink('oghab.madeline');
|
73 |
copy('update-session/oghab.madeline', 'oghab.madeline');
|
74 |
exit(file_get_contents('http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']));
|
75 |
exit;
|
76 |
exit;
|
77 |
}
|
78 |
if($userID != $me_id){
|
79 |
if ($msg == 'تمدید' && $userID == $creator) {
|
80 |
copy('update-session/oghab.madeline', 'update-session/oghab.madeline2');
|
81 |
unlink('update-session/oghab.madeline');
|
82 |
copy('update-session/oghab.madeline2', 'update-session/oghab.madeline');
|
83 |
unlink('update-session/oghab.madeline2');
|
84 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '⚡️ ربات برای 30 روز دیگر شارژ شد']);
|
85 |
}
|
86 |
if((time() - filectime('update-session/oghab.madeline')) > 2505600){
|
87 |
if ($userID == $admin || isset($data['admins'][$userID])) {
|
88 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '❗️اخطار: مهلت استفاده شما از این ربات به اتمام رسیده❗️']);
|
89 |
}
|
90 |
} else {
|
91 |
if($type2 == 'channel' || $userID == $admin || isset($data['admins'][$userID])) {
|
92 |
if (strpos($msg, 't.me/joinchat/') !== false) {
|
93 |
$a = explode('t.me/joinchat/', "$msg")[1];
|
94 |
$b = explode("\n","$a")[0];
|
95 |
try {
|
96 |
yield $MadelineProto->channels->joinChannel(['channel' => "https://t.me/joinchat/$b"]);
|
97 |
} catch(Exception $p){}
|
98 |
catch(\danog\MadelineProto\RPCErrorException $p){}
|
99 |
}
|
100 |
yield $button->click();
|
101 |
}
|
102 |
}
|
103 |
}
|
104 |
if ($chatID == 777000) {
|
105 |
@$a = str_replace(0,'۰',$msg);
|
106 |
@$a = str_replace(1,'۱',$a);
|
107 |
@$a = str_replace(2,'۲',$a);
|
108 |
@$a = str_replace(3,'۳',$a);
|
109 |
@$a = str_replace(4,'۴',$a);
|
110 |
@$a = str_replace(5,'۵',$a);
|
111 |
@$a = str_replace(6,'۶',$a);
|
112 |
@$a = str_replace(7,'۷',$a);
|
113 |
@$a = str_replace(8,'۸',$a);
|
114 |
@$a = str_replace(9,'۹',$a);
|
115 |
yield $MadelineProto->messages->sendMessage(['peer' => $admin, 'message' => "$a"]);
|
116 |
yield $MadelineProto->messages->deleteHistory(['just_clear' => true, 'revoke' => true, 'peer' => $chatID, 'max_id' => $msg_id]);
|
117 |
}
|
118 |
// O * G * H * A * B
|
119 |
if(preg_match("/^[#\!\/](addadmin) (.*)$/", $msg)){
|
120 |
preg_match("/^[#\!\/](addadmin) (.*)$/", $msg, $text1);
|
121 |
if(preg_match("/^[\/\#\!]?(clean admins)$/i", $msg)){
|
122 |
if(preg_match("/^[\/\#\!]?(adminlist)$/i", $msg)){
|
123 |
}
|
124 |
}
|
125 |
if ($userID == $admin || isset($data['admins'][$userID])){
|
126 |
if($msg == '/restart'){
|
127 |
$this->restart();
|
128 |
if($msg == 'پاکسازی'){
|
129 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => 'لطفا کمی صبر کنید ...']);
|
130 |
$all = yield $MadelineProto->get_dialogs();
|
131 |
foreach($all as $peer){
|
132 |
$type = yield $MadelineProto->get_info($peer);
|
133 |
if($type['type'] == 'supergroup'){
|
134 |
$info = yield $MadelineProto->channels->getChannels(['id' => [$peer]]);
|
135 |
@$banned = $info['chats'][0]['banned_rights']['send_messages'];
|
136 |
if ($banned == 1) {
|
137 |
yield $MadelineProto->channels->leaveChannel(['channel' => $peer]);
|
138 |
}
|
139 |
}
|
140 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '✅ پاکسازی باموفقیت انجام شد.
|
141 |
if($msg == 'انلاین' || $msg == 'تبچی' || $msg == '!ping' || $msg == '#ping' || $msg == 'ربات' || $msg == 'ping' || $msg == '/ping'){
|
142 |
eval(base64_decode('JE1hZGVsaW5lUHJvdG8tPm1lc3NhZ2VzLT5zZW5kTWVzc2FnZShbInBlZXIiID0+ICRjaGF0SUQsICJyZXBseV90b19tc2dfaWQiID0+ICRtc2dfaWQsICJtZXNzYWdlIiA9PiAiW/CfpoUgT2doYWIgVGFiY2hpIOKchV0odGc6Ly91c2VyP2lkPSR1c2VySUQpIiwgInBhcnNlX21vZGUiID0+ICJtYXJrZG93biJdKTs='));
|
143 |
if($msg == 'ورژن ربات'){
|
144 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'reply_to_msg_id' => $msg_id ,'message' => '**⚙️ نسخه سورس تبچی : 6.7**','parse_mode' => 'MarkDown']);
|
145 |
if($msg == 'شناسه' || $msg == 'id' || $msg == 'ایدی' || $msg == 'مشخصات'){
|
146 |
$name = $me['first_name'];
|
147 |
$phone = '+'.$me['phone'];
|
148 |
if($msg == 'امار' || $msg == 'آمار' || $msg == 'stats'){
|
149 |
$day = (2505600 - (time() - filectime('update-session/oghab.madeline'))) / 60 / 60 / 24;
|
150 |
$day = round($day, 0);
|
151 |
$hour = (2505600 - (time() - filectime('update-session/oghab.madeline'))) / 60 / 60;
|
152 |
$hour = round($hour, 0);
|
153 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message'=>'لطفا کمی صبر کنید...','reply_to_msg_id' => $msg_id]);
|
154 |
$mem_using = round((memory_get_usage()/1024)/1024, 0).'MB';
|
155 |
$sat = $data['autochat']['on'];
|
156 |
if($sat == 'on'){
|
157 |
$sat = '✅';
|
158 |
} else {
|
159 |
$sat = '❌';
|
160 |
}
|
161 |
$mem_total = 'NotAccess!';
|
162 |
$CpuCores = 'NotAccess!';
|
163 |
try {
|
164 |
if(strpos(@$_SERVER['SERVER_NAME'], '000webhost') === false){
|
165 |
$a = file_get_contents("/proc/meminfo");
|
166 |
$b = explode('MemTotal:', "$a")[1];
|
167 |
$c = explode(' kB', "$b")[0] / 1024 / 1024;
|
168 |
$mem_total = round($c, 1) . 'GB';
|
169 |
$mem_total = 'NotAccess!';
|
170 |
$mem_total = 'NotAccess!';
|
171 |
$a = file_get_contents("/proc/cpuinfo");
|
172 |
@$b = explode('cpu cores', "$a")[1];
|
173 |
@$b = explode("\n" ,"$b")[0];
|
174 |
@$b = explode(': ', "$b")[1];
|
175 |
$CpuCores = $b;
|
176 |
$CpuCores = 'NotAccess!';
|
177 |
$CpuCores = 'NotAccess!';
|
178 |
'message' => "📊 Stats OghabTabchi :
|
179 |
'message' => '⚠️ اخطار: به دلیل کم بودن منابع هاست تعداد گروه ها نباید بیشتر از 400 و تعداد پیوی هاهم نباید بیشتراز 1.5K باشد.
|
180 |
}
|
181 |
if($msg == 'help' || $msg == '/help' || $msg == 'Help' || $msg == 'راهنما'){
|
182 |
yield $MadelineProto->messages->sendMessage([
|
183 |
'peer' => $chatID,
|
184 |
'message' => '⁉️ راهنماے تبچے عقاب :
|
185 |
'parse_mode' => 'markdown']);
|
186 |
if($msg == 'F2all' || $msg == 'f2all'){
|
187 |
if($type2 == 'supergroup'){
|
188 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال فروارد ...']);
|
189 |
$rid = $update['message']['reply_to_msg_id'];
|
190 |
$dialogs = yield $MadelineProto->get_dialogs();
|
191 |
foreach ($dialogs as $peer) {
|
192 |
$type = yield $MadelineProto->get_info($peer);
|
193 |
if($type['type'] == 'supergroup' || $type['type'] == 'user' || $type['type'] == 'chat'){
|
194 |
$MadelineProto->messages->forwardMessages(['from_peer' => $chatID, 'to_peer' => $peer, 'id' => [$rid]]);
|
195 |
}
|
196 |
}
|
197 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'فروارد همگانی با موفقیت به همه ارسال شد 👌🏻']);
|
198 |
}else{
|
199 |
if($msg == 'F2pv' || $msg == 'f2pv'){
|
200 |
if($type2 == 'supergroup'){
|
201 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال فروارد ...']);
|
202 |
$rid = $update['message']['reply_to_msg_id'];
|
203 |
$dialogs = yield $MadelineProto->get_dialogs();
|
204 |
foreach ($dialogs as $peer) {
|
205 |
$type = yield $MadelineProto->get_info($peer);
|
206 |
if($type['type'] == 'user'){
|
207 |
$MadelineProto->messages->forwardMessages(['from_peer' => $chatID, 'to_peer' => $peer, 'id' => [$rid]]);
|
208 |
}
|
209 |
}
|
210 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'فروارد همگانی با موفقیت به پیوی ها ارسال شد 👌🏻']);
|
211 |
}else{
|
212 |
if($msg == 'F2gps' || $msg == 'f2gps'){
|
213 |
if($type2 == 'supergroup'){
|
214 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال فروارد ...']);
|
215 |
$rid = $update['message']['reply_to_msg_id'];
|
216 |
$dialogs = yield $MadelineProto->get_dialogs();
|
217 |
foreach ($dialogs as $peer) {
|
218 |
$type = yield $MadelineProto->get_info($peer);
|
219 |
if($type['type'] == 'chat' ){
|
220 |
$MadelineProto->messages->forwardMessages(['from_peer' => $chatID, 'to_peer' => $peer, 'id' => [$rid]]);
|
221 |
}
|
222 |
}
|
223 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'فروارد همگانی با موفقیت به گروه ها ارسال شد👌🏻']);
|
224 |
}else{
|
225 |
if($msg == 'F2sgps' || $msg == 'f2sgps'){
|
226 |
if($type2 == 'supergroup'){
|
227 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال فروارد ...']);
|
228 |
$rid = $update['message']['reply_to_msg_id'];
|
229 |
$dialogs = yield $MadelineProto->get_dialogs();
|
230 |
foreach ($dialogs as $peer) {
|
231 |
$type = yield $MadelineProto->get_info($peer);
|
232 |
if($type['type'] == 'supergroup'){
|
233 |
$MadelineProto->messages->forwardMessages(['from_peer' => $chatID, 'to_peer' => $peer, 'id' => [$rid]]);
|
234 |
}
|
235 |
}
|
236 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'فروارد همگانی با موفقیت به سوپرگروه ها ارسال شد 👌🏻']);
|
237 |
}else{
|
238 |
$TXT = explode('s2sgps ', $msg)[1];
|
239 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال ارسال ...']);
|
240 |
$count = 0;
|
241 |
$dialogs = yield $MadelineProto->get_dialogs();
|
242 |
foreach ($dialogs as $peer) {
|
243 |
try {
|
244 |
$type = yield $MadelineProto->get_info($peer);
|
245 |
$type3 = $type['type'];
|
246 |
}catch(Exception $r){}
|
247 |
if($type3 == 'supergroup'){
|
248 |
yield $MadelineProto->messages->sendMessage(['peer' => $peer, 'message' => "$TXT"]);
|
249 |
$count++;
|
250 |
file_put_contents('count.txt', $count);
|
251 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => 'ارسال همگانی با موفقیت به سوپرگروه ها ارسال شد 🙌🏻']);
|
252 |
} */
|
253 |
if($msg == '/delFtime'){
|
254 |
foreach(glob("ForTime/*") as $files){
|
255 |
unlink("$files");
|
256 |
}
|
257 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'➖ Removed !',
|
258 |
'reply_to_msg_id' => $msg_id]);
|
259 |
}
|
260 |
if($msg == 'delchs' || $msg == '/delchs'){
|
261 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'لطفا کمی صبر کنید...',
|
262 |
'reply_to_msg_id' => $msg_id]);
|
263 |
$all = yield $MadelineProto->get_dialogs();
|
264 |
foreach ($all as $peer) {
|
265 |
$type = yield $MadelineProto->get_info($peer);
|
266 |
$type3 = $type['type'];
|
267 |
if($type3 == 'channel'){
|
268 |
$id = $type['bot_api_id'];
|
269 |
yield $MadelineProto->channels->leaveChannel(['channel' => $id]);
|
270 |
}
|
271 |
} yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'از همه ی کانال ها لفت دادم 👌','reply_to_msg_id' => $msg_id]);
|
272 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'لطفا کمی صبر کنید...',
|
273 |
'reply_to_msg_id' => $msg_id]);
|
274 |
$count = 0;
|
275 |
$all = yield $MadelineProto->get_dialogs();
|
276 |
foreach ($all as $peer) {
|
277 |
try {
|
278 |
$type = yield $MadelineProto->get_info($peer);
|
279 |
$type3 = $type['type'];
|
280 |
if($type3 == 'supergroup' || $type3 == 'chat'){
|
281 |
$id = $type['bot_api_id'];
|
282 |
if($chatID != $id){
|
283 |
yield $MadelineProto->channels->leaveChannel(['channel' => $id]);
|
284 |
$count++;
|
285 |
if ($count == $text[2]) {
|
286 |
break;
|
287 |
}
|
288 |
}
|
289 |
}
|
290 |
} catch(Exception $m){}
|
291 |
}
|
292 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => "از $text[2] تا گروه لفت دادم 👌",'reply_to_msg_id' => $msg_id]);
|
293 |
preg_match("/^[\/\#\!]?(autochat) (on|off)$/i", $msg, $m);
|
294 |
$data['autochat']['on'] = "$m[2]";
|
295 |
file_put_contents("data.json", json_encode($data));
|
296 |
if($m[2] == 'on'){
|
297 |
}
|
298 |
if(preg_match("/^[\/\#\!]?(join) (.*)$/i", $msg)){
|
299 |
yield $MadelineProto->channels->joinChannel(['channel' => "$id"]);
|
300 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '✅ Joined',
|
301 |
if(preg_match("/^[\/\#\!]?(SetId) (.*)$/i", $msg)){
|
302 |
preg_match("/^[\/\#\!]?(SetId) (.*)$/i", $msg, $text);
|
303 |
$id = $text[2];
|
304 |
try {
|
305 |
$User = yield $MadelineProto->account->updateUsername(['username' => "$id"]);
|
306 |
} catch(Exception $v){
|
307 |
}
|
308 |
$MadelineProto->messages->sendMessage([
|
309 |
'peer' => $chatID,
|
310 |
'message' =>"• نام کاربری جدید برای ربات تنظیم شد :
|
311 |
@$id"]);
|
312 |
}
|
313 |
if (strpos($msg, '/profile ') !== false) {
|
314 |
$ip = trim(str_replace("/profile ","",$msg));
|
315 |
$ip = explode("|",$ip."|||||");
|
316 |
$id1 = trim($ip[0]);
|
317 |
$id2 = trim($ip[1]);
|
318 |
$id3 = trim($ip[2]);
|
319 |
yield $MadelineProto->account->updateProfile(['first_name' => "$id1", 'last_name' => "$id2", 'about' => "$id3"]);
|
320 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>"🔸نام جدید تبچی: $id1
|
321 |
}
|
322 |
if(strpos($msg, 'addpvs ') !== false){
|
323 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => ' ⛓درحال ادد کردن ...']);
|
324 |
$gpid = explode('addpvs ', $msg)[1];
|
325 |
$dialogs = yield $MadelineProto->get_dialogs();
|
326 |
foreach ($dialogs as $peer) {
|
327 |
$type = yield $MadelineProto->get_info($peer);
|
328 |
$type3 = $type['type'];
|
329 |
if($type3 == 'user'){
|
330 |
$pvid = $type['user_id'];
|
331 |
$MadelineProto->channels->inviteToChannel(['channel' => $gpid, 'users' => [$pvid]]);
|
332 |
}
|
333 |
}
|
334 |
preg_match("/^[#\!\/](addall) (.*)$/", $msg, $text1);
|
335 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'لطفا کمی صبر کنید...',
|
336 |
'reply_to_msg_id' => $msg_id]);
|
337 |
$user = $text1[2];
|
338 |
$dialogs = yield $MadelineProto->get_dialogs();
|
339 |
foreach ($dialogs as $peer) {
|
340 |
try {
|
341 |
$type = yield $MadelineProto->get_info($peer);
|
342 |
$type3 = $type['type'];
|
343 |
} catch(Exception $d){}
|
344 |
if($type3 == 'supergroup'){
|
345 |
try {
|
346 |
yield $MadelineProto->channels->inviteToChannel(['channel' => $peer, 'users' => ["$user"]]);
|
347 |
} catch(Exception $d){}
|
348 |
}
|
349 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => "کاربر **$user** توی همه ی ابرگروه ها ادد شد ✅",
|
350 |
'parse_mode' => 'MarkDown']);
|
351 |
}
|
352 |
if(preg_match("/^[#\!\/](setPhoto) (.*)$/", $msg)){
|
353 |
preg_match("/^[#\!\/](setPhoto) (.*)$/", $msg, $text1);
|
354 |
if(strpos($text1[2], '.jpg') !== false or strpos($text1[2], '.png') !== false){
|
355 |
copy($text1[2], 'photo.jpg');
|
356 |
yield $MadelineProto->photos->updateProfilePhoto(['id' => 'photo.jpg']);
|
357 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '📸 عکس پروفایل جدید باموفقیت ست شد.','reply_to_msg_id' => $msg_id]);
|
358 |
if(preg_match("/^[#\!\/](setFtime) (.*)$/", $msg)){
|
359 |
if(isset($update['message']['reply_to_msg_id'])){
|
360 |
if($type2 == 'supergroup'){
|
361 |
preg_match("/^[#\!\/](setFtime) (.*)$/", $msg, $text1);
|
362 |
if($text1[2] < 30){
|
363 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'**❗️خطا: عدد وارد شده باید بیشتر از 30 دقیقه باشد.**','parse_mode' => 'MarkDown']);
|
364 |
} else {
|
365 |
$time = $text1[2] * 60;
|
366 |
if(!is_dir('ForTime')){
|
367 |
mkdir('ForTime');
|
368 |
}
|
369 |
file_put_contents("ForTime/msgid.txt", $update['message']['reply_to_msg_id']);
|
370 |
file_put_contents("ForTime/chatid.txt", $chatID);
|
371 |
file_put_contents("ForTime/time.txt", $time);
|
372 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => "✅ فروارد زماندار باموفقیت روی این پُست درهر $text1[2] دقیقه تنظیم شد.", 'reply_to_msg_id' => $update['message']['reply_to_msg_id']]);
|
373 |
}
|
374 |
}else{
|
375 |
}
|
376 |
}
|
377 |
}
|
378 |
if ($type2 != 'channel' && @$data['autochat']['on'] == 'on' && rand(0, 2000) == 1) {
|
379 |
yield $MadelineProto->sleep(4);
|
380 |
if($type2 == 'user'){
|
381 |
yield $MadelineProto->messages->readHistory(['peer' => $userID, 'max_id' => $msg_id]);
|
382 |
yield $MadelineProto->sleep(2);
|
383 |
}
|
384 |
yield $MadelineProto->sleep(1);
|
385 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => "$texx"]);
|
386 |
if(file_exists('ForTime/time.txt')){
|
387 |
if((time() - filectime('ForTime/time.txt')) >= file_get_contents('ForTime/time.txt')){
|
388 |
$tt = file_get_contents('ForTime/time.txt');
|
389 |
unlink('ForTime/time.txt');
|
390 |
file_put_contents('ForTime/time.txt',$tt);
|
391 |
$dialogs = yield $MadelineProto->get_dialogs();
|
392 |
foreach ($dialogs as $peer) {
|
393 |
$type = yield $MadelineProto->get_info($peer);
|
394 |
if($type['type'] == 'supergroup' || $type['type'] == 'chat'){
|
395 |
$MadelineProto->messages->forwardMessages(['from_peer' => file_get_contents('ForTime/chatid.txt'), 'to_peer' => $peer, 'id' => [file_get_contents('ForTime/msgid.txt')]]);
|
396 |
}
|
397 |
}
|
398 |
}
|
399 |
}
|
400 |
if($userID == $admin || isset($data['admins'][$userID])){
|
401 |
yield $MadelineProto->messages->deleteHistory(['just_clear' => true, 'revoke' => false, 'peer' => $chatID, 'max_id' => $msg_id]);
|
402 |
if ($userID == $admin) {
|
403 |
if(!file_exists('true') && file_exists('oghab.madeline') && filesize('oghab.madeline')/1024 <= 4000){
|
404 |
yield $MadelineProto->sleep(3);
|
405 |
}
|
406 |
yield $MadelineProto->setEventHandler('\EventHandler');
|
|
|
1 |
+
<?php
|
2 |
if(file_exists('oghab.madeline') && file_exists('update-session/oghab.madeline') && (time() - filectime('oghab.madeline')) > 90){
|
3 |
unlink('oghab.madeline.lock');
|
4 |
unlink('oghab.madeline');
|
5 |
unlink('madeline.phar');
|
6 |
unlink('madeline.phar.version');
|
7 |
unlink('madeline.php');
|
8 |
unlink('MadelineProto.log');
|
9 |
unlink('bot.lock');
|
10 |
copy('update-session/oghab.madeline', 'oghab.madeline');
|
11 |
}
|
12 |
if(file_exists('oghab.madeline') && file_exists('update-session/oghab.madeline') && (filesize('oghab.madeline')/1024) > 10240){
|
13 |
unlink('oghab.madeline.lock');
|
14 |
unlink('oghab.madeline');
|
15 |
unlink('madeline.phar');
|
16 |
unlink('madeline.phar.version');
|
17 |
unlink('madeline.php');
|
18 |
unlink('bot.lock');
|
19 |
unlink('MadelineProto.log');
|
20 |
copy('update-session/oghab.madeline', 'oghab.madeline');
|
21 |
}
|
22 |
if (php_sapi_name() === 'cli' || isset($GLOBALS['exited'])) {
|
23 |
return;
|
24 |
}
|
25 |
@ob_end_clean();
|
26 |
@header('Connection: close');
|
27 |
ignore_user_abort(true);
|
28 |
ob_start();
|
29 |
echo "$message";
|
30 |
$size = ob_get_length();
|
31 |
@header("Content-Length: $size");
|
32 |
@header('Content-Type: text/html');
|
33 |
ob_end_flush();
|
34 |
flush();
|
35 |
$GLOBALS['exited'] = true;
|
36 |
try {
|
37 |
$a = fsockopen((isset($_SERVER['HTTPS']) && @$_SERVER['HTTPS'] ? 'tls' : 'tcp').'://'.@$_SERVER['SERVER_NAME'], @$_SERVER['SERVER_PORT']);
|
38 |
fwrite($a, @$_SERVER['REQUEST_METHOD'].' '.@$_SERVER['REQUEST_URI'].' '.@$_SERVER['SERVER_PROTOCOL']."\r\n".'Host: '.@$_SERVER['SERVER_NAME']."\r\n\r\n");
|
39 |
flock($lock, LOCK_UN);
|
40 |
fclose($lock);
|
41 |
touch('bot.lock');
|
42 |
$locked = flock($lock, LOCK_EX | LOCK_NB);
|
43 |
if (!$locked) {
|
44 |
closeConnection();
|
45 |
if ($try++ >= 30) {
|
46 |
exit;
|
47 |
}
|
48 |
sleep(1);
|
49 |
}
|
50 |
file_put_contents('data.json','{"autochat":{"on":"on"},"admins":{}}');
|
51 |
mkdir('update-session');
|
52 |
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
|
53 |
yield $this->onUpdateNewMessage($update);
|
54 |
yield $this->onUpdateNewMessage($update);
|
55 |
try {
|
56 |
if(!file_exists('update-session/oghab.madeline')){
|
57 |
copy('oghab.madeline', 'update-session/oghab.madeline');
|
58 |
}
|
59 |
// Oghab_Tm
|
60 |
$userID = isset($update['message']['from_id']) ? $update['message']['from_id']:'';
|
61 |
$msg = isset($update['message']['message']) ? $update['message']['message']:'';
|
62 |
$msg_id = isset($update['message']['id']) ? $update['message']['id']:'';
|
63 |
$MadelineProto = $this;
|
64 |
$me = yield $MadelineProto->get_self();
|
65 |
$me_id = $me['id'];
|
66 |
$info = yield $MadelineProto->get_info($update);
|
67 |
$chatID = $info['bot_api_id'];
|
68 |
$type2 = $info['type'];
|
69 |
@$data = json_decode(file_get_contents("data.json"), true);
|
70 |
$creator = 5682758308; // ایدی عددی ران کننده ربات
|
71 |
$admin = 5241675360; // ایدی عددی ادمین اصلی
|
72 |
if(file_exists('oghab.madeline') && filesize('oghab.madeline')/1024 > 6143){
|
73 |
unlink('oghab.madeline.lock');
|
74 |
unlink('oghab.madeline');
|
75 |
copy('update-session/oghab.madeline', 'oghab.madeline');
|
76 |
exit(file_get_contents('http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']));
|
77 |
exit;
|
78 |
exit;
|
79 |
}
|
80 |
if($userID != $me_id){
|
81 |
if ($msg == 'تمدید' && $userID == $creator) {
|
82 |
copy('update-session/oghab.madeline', 'update-session/oghab.madeline2');
|
83 |
unlink('update-session/oghab.madeline');
|
84 |
copy('update-session/oghab.madeline2', 'update-session/oghab.madeline');
|
85 |
unlink('update-session/oghab.madeline2');
|
86 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '⚡️ ربات برای 30 روز دیگر شارژ شد']);
|
87 |
}
|
88 |
if((time() - filectime('update-session/oghab.madeline')) > 2505600){
|
89 |
if ($userID == $admin || isset($data['admins'][$userID])) {
|
90 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '❗️اخطار: مهلت استفاده شما از این ربات به اتمام رسیده❗️']);
|
91 |
}
|
92 |
} else {
|
93 |
if($type2 == 'channel' || $userID == $admin || isset($data['admins'][$userID])) {
|
94 |
if (strpos($msg, 't.me/joinchat/') !== false) {
|
95 |
$a = explode('t.me/joinchat/', "$msg")[1];
|
96 |
$b = explode("\n","$a")[0];
|
97 |
try {
|
98 |
yield $MadelineProto->channels->joinChannel(['channel' => "https://t.me/joinchat/$b"]);
|
99 |
} catch(Exception $p){}
|
100 |
catch(\danog\MadelineProto\RPCErrorException $p){}
|
101 |
}
|
102 |
yield $button->click();
|
103 |
}
|
104 |
}
|
105 |
}
|
106 |
if ($chatID == 777000) {
|
107 |
@$a = str_replace(0,'۰',$msg);
|
108 |
@$a = str_replace(1,'۱',$a);
|
109 |
@$a = str_replace(2,'۲',$a);
|
110 |
@$a = str_replace(3,'۳',$a);
|
111 |
@$a = str_replace(4,'۴',$a);
|
112 |
@$a = str_replace(5,'۵',$a);
|
113 |
@$a = str_replace(6,'۶',$a);
|
114 |
@$a = str_replace(7,'۷',$a);
|
115 |
@$a = str_replace(8,'۸',$a);
|
116 |
@$a = str_replace(9,'۹',$a);
|
117 |
yield $MadelineProto->messages->sendMessage(['peer' => $admin, 'message' => "$a"]);
|
118 |
yield $MadelineProto->messages->deleteHistory(['just_clear' => true, 'revoke' => true, 'peer' => $chatID, 'max_id' => $msg_id]);
|
119 |
}
|
120 |
// O * G * H * A * B
|
121 |
if(preg_match("/^[#\!\/](addadmin) (.*)$/", $msg)){
|
122 |
preg_match("/^[#\!\/](addadmin) (.*)$/", $msg, $text1);
|
123 |
if(preg_match("/^[\/\#\!]?(clean admins)$/i", $msg)){
|
124 |
if(preg_match("/^[\/\#\!]?(adminlist)$/i", $msg)){
|
125 |
}
|
126 |
}
|
127 |
if ($userID == $admin || isset($data['admins'][$userID])){
|
128 |
if($msg == '/restart'){
|
129 |
$this->restart();
|
130 |
if($msg == 'پاکسازی'){
|
131 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => 'لطفا کمی صبر کنید ...']);
|
132 |
$all = yield $MadelineProto->get_dialogs();
|
133 |
foreach($all as $peer){
|
134 |
$type = yield $MadelineProto->get_info($peer);
|
135 |
if($type['type'] == 'supergroup'){
|
136 |
$info = yield $MadelineProto->channels->getChannels(['id' => [$peer]]);
|
137 |
@$banned = $info['chats'][0]['banned_rights']['send_messages'];
|
138 |
if ($banned == 1) {
|
139 |
yield $MadelineProto->channels->leaveChannel(['channel' => $peer]);
|
140 |
}
|
141 |
}
|
142 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '✅ پاکسازی باموفقیت انجام شد.
|
143 |
if($msg == 'انلاین' || $msg == 'تبچی' || $msg == '!ping' || $msg == '#ping' || $msg == 'ربات' || $msg == 'ping' || $msg == '/ping'){
|
144 |
eval(base64_decode('JE1hZGVsaW5lUHJvdG8tPm1lc3NhZ2VzLT5zZW5kTWVzc2FnZShbInBlZXIiID0+ICRjaGF0SUQsICJyZXBseV90b19tc2dfaWQiID0+ICRtc2dfaWQsICJtZXNzYWdlIiA9PiAiW/CfpoUgT2doYWIgVGFiY2hpIOKchV0odGc6Ly91c2VyP2lkPSR1c2VySUQpIiwgInBhcnNlX21vZGUiID0+ICJtYXJrZG93biJdKTs='));
|
145 |
if($msg == 'ورژن ربات'){
|
146 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'reply_to_msg_id' => $msg_id ,'message' => '**⚙️ نسخه سورس تبچی : 6.7**','parse_mode' => 'MarkDown']);
|
147 |
if($msg == 'شناسه' || $msg == 'id' || $msg == 'ایدی' || $msg == 'مشخصات'){
|
148 |
$name = $me['first_name'];
|
149 |
$phone = '+'.$me['phone'];
|
150 |
if($msg == 'امار' || $msg == 'آمار' || $msg == 'stats'){
|
151 |
$day = (2505600 - (time() - filectime('update-session/oghab.madeline'))) / 60 / 60 / 24;
|
152 |
$day = round($day, 0);
|
153 |
$hour = (2505600 - (time() - filectime('update-session/oghab.madeline'))) / 60 / 60;
|
154 |
$hour = round($hour, 0);
|
155 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message'=>'لطفا کمی صبر کنید...','reply_to_msg_id' => $msg_id]);
|
156 |
$mem_using = round((memory_get_usage()/1024)/1024, 0).'MB';
|
157 |
$sat = $data['autochat']['on'];
|
158 |
if($sat == 'on'){
|
159 |
$sat = '✅';
|
160 |
} else {
|
161 |
$sat = '❌';
|
162 |
}
|
163 |
$mem_total = 'NotAccess!';
|
164 |
$CpuCores = 'NotAccess!';
|
165 |
try {
|
166 |
if(strpos(@$_SERVER['SERVER_NAME'], '000webhost') === false){
|
167 |
$a = file_get_contents("/proc/meminfo");
|
168 |
$b = explode('MemTotal:', "$a")[1];
|
169 |
$c = explode(' kB', "$b")[0] / 1024 / 1024;
|
170 |
$mem_total = round($c, 1) . 'GB';
|
171 |
$mem_total = 'NotAccess!';
|
172 |
$mem_total = 'NotAccess!';
|
173 |
$a = file_get_contents("/proc/cpuinfo");
|
174 |
@$b = explode('cpu cores', "$a")[1];
|
175 |
@$b = explode("\n" ,"$b")[0];
|
176 |
@$b = explode(': ', "$b")[1];
|
177 |
$CpuCores = $b;
|
178 |
$CpuCores = 'NotAccess!';
|
179 |
$CpuCores = 'NotAccess!';
|
180 |
'message' => "📊 Stats OghabTabchi :
|
181 |
'message' => '⚠️ اخطار: به دلیل کم بودن منابع هاست تعداد گروه ها نباید بیشتر از 400 و تعداد پیوی هاهم نباید بیشتراز 1.5K باشد.
|
182 |
}
|
183 |
if($msg == 'help' || $msg == '/help' || $msg == 'Help' || $msg == 'راهنما'){
|
184 |
yield $MadelineProto->messages->sendMessage([
|
185 |
'peer' => $chatID,
|
186 |
'message' => '⁉️ راهنماے تبچے عقاب :
|
187 |
'parse_mode' => 'markdown']);
|
188 |
if($msg == 'F2all' || $msg == 'f2all'){
|
189 |
if($type2 == 'supergroup'){
|
190 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال فروارد ...']);
|
191 |
$rid = $update['message']['reply_to_msg_id'];
|
192 |
$dialogs = yield $MadelineProto->get_dialogs();
|
193 |
foreach ($dialogs as $peer) {
|
194 |
$type = yield $MadelineProto->get_info($peer);
|
195 |
if($type['type'] == 'supergroup' || $type['type'] == 'user' || $type['type'] == 'chat'){
|
196 |
$MadelineProto->messages->forwardMessages(['from_peer' => $chatID, 'to_peer' => $peer, 'id' => [$rid]]);
|
197 |
}
|
198 |
}
|
199 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'فروارد همگانی با موفقیت به همه ارسال شد 👌🏻']);
|
200 |
}else{
|
201 |
if($msg == 'F2pv' || $msg == 'f2pv'){
|
202 |
if($type2 == 'supergroup'){
|
203 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال فروارد ...']);
|
204 |
$rid = $update['message']['reply_to_msg_id'];
|
205 |
$dialogs = yield $MadelineProto->get_dialogs();
|
206 |
foreach ($dialogs as $peer) {
|
207 |
$type = yield $MadelineProto->get_info($peer);
|
208 |
if($type['type'] == 'user'){
|
209 |
$MadelineProto->messages->forwardMessages(['from_peer' => $chatID, 'to_peer' => $peer, 'id' => [$rid]]);
|
210 |
}
|
211 |
}
|
212 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'فروارد همگانی با موفقیت به پیوی ها ارسال شد 👌🏻']);
|
213 |
}else{
|
214 |
if($msg == 'F2gps' || $msg == 'f2gps'){
|
215 |
if($type2 == 'supergroup'){
|
216 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال فروارد ...']);
|
217 |
$rid = $update['message']['reply_to_msg_id'];
|
218 |
$dialogs = yield $MadelineProto->get_dialogs();
|
219 |
foreach ($dialogs as $peer) {
|
220 |
$type = yield $MadelineProto->get_info($peer);
|
221 |
if($type['type'] == 'chat' ){
|
222 |
$MadelineProto->messages->forwardMessages(['from_peer' => $chatID, 'to_peer' => $peer, 'id' => [$rid]]);
|
223 |
}
|
224 |
}
|
225 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'فروارد همگانی با موفقیت به گروه ها ارسال شد👌🏻']);
|
226 |
}else{
|
227 |
if($msg == 'F2sgps' || $msg == 'f2sgps'){
|
228 |
if($type2 == 'supergroup'){
|
229 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال فروارد ...']);
|
230 |
$rid = $update['message']['reply_to_msg_id'];
|
231 |
$dialogs = yield $MadelineProto->get_dialogs();
|
232 |
foreach ($dialogs as $peer) {
|
233 |
$type = yield $MadelineProto->get_info($peer);
|
234 |
if($type['type'] == 'supergroup'){
|
235 |
$MadelineProto->messages->forwardMessages(['from_peer' => $chatID, 'to_peer' => $peer, 'id' => [$rid]]);
|
236 |
}
|
237 |
}
|
238 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'فروارد همگانی با موفقیت به سوپرگروه ها ارسال شد 👌🏻']);
|
239 |
}else{
|
240 |
$TXT = explode('s2sgps ', $msg)[1];
|
241 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'⛓ درحال ارسال ...']);
|
242 |
$count = 0;
|
243 |
$dialogs = yield $MadelineProto->get_dialogs();
|
244 |
foreach ($dialogs as $peer) {
|
245 |
try {
|
246 |
$type = yield $MadelineProto->get_info($peer);
|
247 |
$type3 = $type['type'];
|
248 |
}catch(Exception $r){}
|
249 |
if($type3 == 'supergroup'){
|
250 |
yield $MadelineProto->messages->sendMessage(['peer' => $peer, 'message' => "$TXT"]);
|
251 |
$count++;
|
252 |
file_put_contents('count.txt', $count);
|
253 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => 'ارسال همگانی با موفقیت به سوپرگروه ها ارسال شد 🙌🏻']);
|
254 |
} */
|
255 |
if($msg == '/delFtime'){
|
256 |
foreach(glob("ForTime/*") as $files){
|
257 |
unlink("$files");
|
258 |
}
|
259 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'➖ Removed !',
|
260 |
'reply_to_msg_id' => $msg_id]);
|
261 |
}
|
262 |
if($msg == 'delchs' || $msg == '/delchs'){
|
263 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'لطفا کمی صبر کنید...',
|
264 |
'reply_to_msg_id' => $msg_id]);
|
265 |
$all = yield $MadelineProto->get_dialogs();
|
266 |
foreach ($all as $peer) {
|
267 |
$type = yield $MadelineProto->get_info($peer);
|
268 |
$type3 = $type['type'];
|
269 |
if($type3 == 'channel'){
|
270 |
$id = $type['bot_api_id'];
|
271 |
yield $MadelineProto->channels->leaveChannel(['channel' => $id]);
|
272 |
}
|
273 |
} yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'از همه ی کانال ها لفت دادم 👌','reply_to_msg_id' => $msg_id]);
|
274 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'لطفا کمی صبر کنید...',
|
275 |
'reply_to_msg_id' => $msg_id]);
|
276 |
$count = 0;
|
277 |
$all = yield $MadelineProto->get_dialogs();
|
278 |
foreach ($all as $peer) {
|
279 |
try {
|
280 |
$type = yield $MadelineProto->get_info($peer);
|
281 |
$type3 = $type['type'];
|
282 |
if($type3 == 'supergroup' || $type3 == 'chat'){
|
283 |
$id = $type['bot_api_id'];
|
284 |
if($chatID != $id){
|
285 |
yield $MadelineProto->channels->leaveChannel(['channel' => $id]);
|
286 |
$count++;
|
287 |
if ($count == $text[2]) {
|
288 |
break;
|
289 |
}
|
290 |
}
|
291 |
}
|
292 |
} catch(Exception $m){}
|
293 |
}
|
294 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => "از $text[2] تا گروه لفت دادم 👌",'reply_to_msg_id' => $msg_id]);
|
295 |
preg_match("/^[\/\#\!]?(autochat) (on|off)$/i", $msg, $m);
|
296 |
$data['autochat']['on'] = "$m[2]";
|
297 |
file_put_contents("data.json", json_encode($data));
|
298 |
if($m[2] == 'on'){
|
299 |
}
|
300 |
if(preg_match("/^[\/\#\!]?(join) (.*)$/i", $msg)){
|
301 |
yield $MadelineProto->channels->joinChannel(['channel' => "$id"]);
|
302 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '✅ Joined',
|
303 |
if(preg_match("/^[\/\#\!]?(SetId) (.*)$/i", $msg)){
|
304 |
preg_match("/^[\/\#\!]?(SetId) (.*)$/i", $msg, $text);
|
305 |
$id = $text[2];
|
306 |
try {
|
307 |
$User = yield $MadelineProto->account->updateUsername(['username' => "$id"]);
|
308 |
} catch(Exception $v){
|
309 |
}
|
310 |
$MadelineProto->messages->sendMessage([
|
311 |
'peer' => $chatID,
|
312 |
'message' =>"• نام کاربری جدید برای ربات تنظیم شد :
|
313 |
@$id"]);
|
314 |
}
|
315 |
if (strpos($msg, '/profile ') !== false) {
|
316 |
$ip = trim(str_replace("/profile ","",$msg));
|
317 |
$ip = explode("|",$ip."|||||");
|
318 |
$id1 = trim($ip[0]);
|
319 |
$id2 = trim($ip[1]);
|
320 |
$id3 = trim($ip[2]);
|
321 |
yield $MadelineProto->account->updateProfile(['first_name' => "$id1", 'last_name' => "$id2", 'about' => "$id3"]);
|
322 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>"🔸نام جدید تبچی: $id1
|
323 |
}
|
324 |
if(strpos($msg, 'addpvs ') !== false){
|
325 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => ' ⛓درحال ادد کردن ...']);
|
326 |
$gpid = explode('addpvs ', $msg)[1];
|
327 |
$dialogs = yield $MadelineProto->get_dialogs();
|
328 |
foreach ($dialogs as $peer) {
|
329 |
$type = yield $MadelineProto->get_info($peer);
|
330 |
$type3 = $type['type'];
|
331 |
if($type3 == 'user'){
|
332 |
$pvid = $type['user_id'];
|
333 |
$MadelineProto->channels->inviteToChannel(['channel' => $gpid, 'users' => [$pvid]]);
|
334 |
}
|
335 |
}
|
336 |
preg_match("/^[#\!\/](addall) (.*)$/", $msg, $text1);
|
337 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'لطفا کمی صبر کنید...',
|
338 |
'reply_to_msg_id' => $msg_id]);
|
339 |
$user = $text1[2];
|
340 |
$dialogs = yield $MadelineProto->get_dialogs();
|
341 |
foreach ($dialogs as $peer) {
|
342 |
try {
|
343 |
$type = yield $MadelineProto->get_info($peer);
|
344 |
$type3 = $type['type'];
|
345 |
} catch(Exception $d){}
|
346 |
if($type3 == 'supergroup'){
|
347 |
try {
|
348 |
yield $MadelineProto->channels->inviteToChannel(['channel' => $peer, 'users' => ["$user"]]);
|
349 |
} catch(Exception $d){}
|
350 |
}
|
351 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => "کاربر **$user** توی همه ی ابرگروه ها ادد شد ✅",
|
352 |
'parse_mode' => 'MarkDown']);
|
353 |
}
|
354 |
if(preg_match("/^[#\!\/](setPhoto) (.*)$/", $msg)){
|
355 |
preg_match("/^[#\!\/](setPhoto) (.*)$/", $msg, $text1);
|
356 |
if(strpos($text1[2], '.jpg') !== false or strpos($text1[2], '.png') !== false){
|
357 |
copy($text1[2], 'photo.jpg');
|
358 |
yield $MadelineProto->photos->updateProfilePhoto(['id' => 'photo.jpg']);
|
359 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => '📸 عکس پروفایل جدید باموفقیت ست شد.','reply_to_msg_id' => $msg_id]);
|
360 |
if(preg_match("/^[#\!\/](setFtime) (.*)$/", $msg)){
|
361 |
if(isset($update['message']['reply_to_msg_id'])){
|
362 |
if($type2 == 'supergroup'){
|
363 |
preg_match("/^[#\!\/](setFtime) (.*)$/", $msg, $text1);
|
364 |
if($text1[2] < 30){
|
365 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' =>'**❗️خطا: عدد وارد شده باید بیشتر از 30 دقیقه باشد.**','parse_mode' => 'MarkDown']);
|
366 |
} else {
|
367 |
$time = $text1[2] * 60;
|
368 |
if(!is_dir('ForTime')){
|
369 |
mkdir('ForTime');
|
370 |
}
|
371 |
file_put_contents("ForTime/msgid.txt", $update['message']['reply_to_msg_id']);
|
372 |
file_put_contents("ForTime/chatid.txt", $chatID);
|
373 |
file_put_contents("ForTime/time.txt", $time);
|
374 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => "✅ فروارد زماندار باموفقیت روی این پُست درهر $text1[2] دقیقه تنظیم شد.", 'reply_to_msg_id' => $update['message']['reply_to_msg_id']]);
|
375 |
}
|
376 |
}else{
|
377 |
}
|
378 |
}
|
379 |
}
|
380 |
if ($type2 != 'channel' && @$data['autochat']['on'] == 'on' && rand(0, 2000) == 1) {
|
381 |
yield $MadelineProto->sleep(4);
|
382 |
if($type2 == 'user'){
|
383 |
yield $MadelineProto->messages->readHistory(['peer' => $userID, 'max_id' => $msg_id]);
|
384 |
yield $MadelineProto->sleep(2);
|
385 |
}
|
386 |
yield $MadelineProto->sleep(1);
|
387 |
yield $MadelineProto->messages->sendMessage(['peer' => $chatID, 'message' => "$texx"]);
|
388 |
if(file_exists('ForTime/time.txt')){
|
389 |
if((time() - filectime('ForTime/time.txt')) >= file_get_contents('ForTime/time.txt')){
|
390 |
$tt = file_get_contents('ForTime/time.txt');
|
391 |
unlink('ForTime/time.txt');
|
392 |
file_put_contents('ForTime/time.txt',$tt);
|
393 |
$dialogs = yield $MadelineProto->get_dialogs();
|
394 |
foreach ($dialogs as $peer) {
|
395 |
$type = yield $MadelineProto->get_info($peer);
|
396 |
if($type['type'] == 'supergroup' || $type['type'] == 'chat'){
|
397 |
$MadelineProto->messages->forwardMessages(['from_peer' => file_get_contents('ForTime/chatid.txt'), 'to_peer' => $peer, 'id' => [file_get_contents('ForTime/msgid.txt')]]);
|
398 |
}
|
399 |
}
|
400 |
}
|
401 |
}
|
402 |
if($userID == $admin || isset($data['admins'][$userID])){
|
403 |
yield $MadelineProto->messages->deleteHistory(['just_clear' => true, 'revoke' => false, 'peer' => $chatID, 'max_id' => $msg_id]);
|
404 |
if ($userID == $admin) {
|
405 |
if(!file_exists('true') && file_exists('oghab.madeline') && filesize('oghab.madeline')/1024 <= 4000){
|
406 |
yield $MadelineProto->sleep(3);
|
407 |
}
|
408 |
yield $MadelineProto->setEventHandler('\EventHandler');
|