-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin.lua
More file actions
507 lines (502 loc) · 29 KB
/
plugin.lua
File metadata and controls
507 lines (502 loc) · 29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
function run(msg)
help_sudo = "*Sudo Commands:*\n______________________________\n"
.." /req\n ليست درخواستها\n\n"
.." /req>\n کیبرد ليست درخواستها\n\n"
.." /sendtoall {text}\n ارسال به همه\n\n"
.." /users\n کاربران ربات\n\n"
.." /info {text}\n توضيحات شما\n\n"
.." /avatar {reply photo}\n آواتار شما\n\n"
.." /block {id},{in chat}\n بلاک کردن\n\n"
.." /unblock {id}\n آن بلاک\n\n"
.." /blocklist\n ليست افراد بلاک\n\n"
.." /blocklist>\n کیبرد افراد بلاک\n\n"
.." /promote {id}\n اجازه ارسال پيامک\n\n"
.." /demote {id}\n گرفتن دسترسي\n\n"
.." /friends\n ليست دوستان\n\n"
.." /friends>\n کیبرد لیست دوستان\n\n"
.." /del {id}\n رد درخواست\n\n"
.." /chat {id}\n شروع چت\n\n"
.." /end\n اتمام چت\n\n"
.." /spam {id,num,text}\n اسپم دادن\n\n"
.." /key\n کيبرد ادمين\n\n"
about_txt = "ربات پیام رسان نسخه vip-"..bot_version.."\nبا قابلیت اینلاین!\n\n`از طریق این ربات حتی اگر ریپورت هم باشید میتوانید با من چت کنید. برای این کار کافیست که یک درخواست چت برایم ارسال کنید و منتظر باشید تا آن را قبول کنم. میتوانید از طریق کلید مربوطه شمارتونو برام بفرستید تا در صورت لزوم با شما تماس بگیرم. این ربات قابلیت های دیگه هم داره، میتونید بیوگرافیمو بخونید، شمارمو از ربات دریافت کنید. از طریق قابلیت اینلاین در هر کجا میتونید شماره و در صورت وجود، بیوگرافیمو به اشتراک بذارید.`\n\nاگر مایل به هستید از این ربات برای خودتون داشته باشید، با سازنده ی من تماس بگیرید، اطلاعات تماس سازنده در لینکهای زیر است. این ربات توسط تیم قدرتمند تل استریک و ساخته شده است."
about_key = {{{text = "کانال تیم استریک" , url = "https://telegram.me/TeleStRiKe"}},{{text = "ادمین" , url = "https://telegram.me/AdMinTMstRiKe"}},{{text = "سدو وسازنده تل استریک" , url = "https://telegram.me/SuDoTMstRiKe"}}}
start_txt = "سلام دوست عزيز\n\n`از طریق این ربات حتی اگر ریپورت باشی هم میتونی با من چت کنی. این ربات قابلیت های دیگه ای هم داره که از کیبرد زیر میتونی بهشون دست پیدا کنی. اگر از این ربات پیشرفته ی پیام رسان یاانواع ربات از معلومی تا... نیاز داری، روی کلید زیر کلیک کن. این ربات رایگان نیست و توسط تیم قدرتمند تل استریک طراحی و ساخته شده.`"
start_key = {{{text="ساخت ربات پیام رسان",url="https://telegram.me/SuDoTMstRiKe"}}}
keyboard = {{"ارسال درخواست چت"},{{text="ارسال شماره شما به من",request_contact=true},{text="ارسال مکان شما به من",request_location=true}},{"شماره من","ارسال پیامک به من"},{"بیوگرافی من","ربات نسخه"..bot_version}}
------------------------------------------------------------------------------------
blocks = load_data("blocks.json")
chats = load_data("chats.json")
requests = load_data("requests.json")
contact = load_data("contact.json")
location = load_data("location.json")
users = load_data("users.json")
admins = load_data("admins.json")
setting = load_data("setting.json")
userid = tostring(msg.from.id)
msg.text = msg.text:gsub("@"..bot.username,"")
if msg.chat.id == admingp then
elseif msg.chat.type == "channel" or msg.chat.type == "supergroup" or msg.chat.type == "group" then
return
end
if not users[userid] then
users[userid] = true
save_data("users.json", users)
send_inline(msg.from.id, start_txt, start_key)
return send_key(msg.from.id, "`کیبرد اصلی:`", keyboard)
end
if msg.text == "/start" then
users[userid] = true
save_data("users.json", users)
send_inline(msg.from.id, start_txt, start_key)
return send_key(msg.from.id, "`کیبرد اصلی:`", keyboard)
elseif msg.contact then
if chats.id == msg.from.id then
else
if contact[userid] then
if contact[userid][msg.contact.phone_number] then
return send_msg(msg.from.id, "`شما قبلا این شماره را ارسال کرده اید`\n_You sent_ *this number* _ago_", true)
else
if #contact[userid] > 10 then
return send_msg(msg.from.id, "`دیگر نمیتوانید شماره ای ارسال کنید!`\n_You_ *Can't* _send new number!_", true)
end
table.insert(contact[userid], msg.contact.phone_number)
save_data("contact.json", contact)
send_msg(msg.from.id, "`شماره شما ارسال شد`\n_You'r number_ *Sent*", true)
send_msg(admingp, (msg.from.first_name or "").." "..(msg.from.last_name or "").." [@"..(msg.from.username or "-----").."] ("..msg.from.id..")", false)
return send_fwrd(admingp, msg.from.id, msg.message_id)
end
else
contact[userid] = {}
table.insert(contact[userid], msg.contact.phone_number)
save_data("contact.json", contact)
send_msg(msg.from.id, "`شماره شما ارسال شد`\n_You'r number_ *Sent*", true)
send_msg(admingp, (msg.from.first_name or "").." "..(msg.from.last_name or "").." [@"..(msg.from.username or "-----").."] ("..msg.from.id..")", false)
return send_fwrd(admingp, msg.from.id, msg.message_id)
end
end
elseif msg.location then
if chats.id == msg.from.id then
else
if location[userid] then
if location[userid][msg.location.longitude] then
return send_msg(msg.from.id, "`شما قبلا این موقعیت مکانی را ارسال کرده اید`\n_You sent_ *this location* _ago_", true)
else
if #location[userid] > 10 then
return send_msg(msg.from.id, "`دیگر نمیتوانید موقعیت مکانی ارسال کنید!`\n_You_ *Can't* _send new location!_", true)
end
table.insert(location[userid], msg.location.longitude)
save_data("location.json", location)
send_msg(msg.from.id, "`موقعیت مکانی شما ارسال شد`\n_You'r location_ *Sent*", true)
send_msg(admingp, (msg.from.first_name or "").." "..(msg.from.last_name or "").." [@"..(msg.from.username or "-----").."] ("..msg.from.id..")", false)
return send_fwrd(admingp, msg.from.id, msg.message_id)
end
else
location[userid] = {}
table.insert(location[userid], msg.location.longitude)
save_data("location.json", location)
send_msg(msg.from.id, "`موقعیت مکانی شما ارسال شد`\n_You'r location_ *Sent*", true)
send_msg(admingp, (msg.from.first_name or "").." "..(msg.from.last_name or "").." [@"..(msg.from.username or "-----").."] ("..msg.from.id..")", false)
return send_fwrd(admingp, msg.from.id, msg.message_id)
end
end
elseif msg.text:find("/spam") and msg.chat.id == admingp then
local target = msg.text:input()
if target then
local target = target:split(",")
if #target == 3 then
send_msg(admingp, "`شخص مورد نظر در حال اسپم خوردن است`\n_Your target_ *Spamming*", true)
for i=1,tonumber(target[2]) do
send_msg(tonumber(target[1]), target[3])
end
return send_msg(admingp, "`اسپم به اتمام رسید`\n_Spamming_ *Stoped*", true)
elseif #target == 2 then
send_msg(admingp, "`شخص مورد نظر در حال اسپم خوردن است`\n_Your target_ *Spamming*", true)
for i=1,tonumber(target[2]) do
send_msg(tonumber(target[1]), "StRiKE team\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\StRiKE Team")
end
return send_msg(admingp, "`اسپم به اتمام رسید`\n_Spamming_ *Stoped*", true)
else
send_msg(admingp, "`شخص مورد نظر در حال اسپم خوردن است`\n_Your target_ *Spamming*", true)
for i=1,100 do
send_msg(tonumber(target[1]), "StRiKE team\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\StRiKE Team")
end
return send_msg(admingp, "`اسپم به اتمام رسید`\n_Spamming_ *Stoped*", true)
end
else
return send_msg(admingp, "`بعد از این دستور آی دی شخص مورد نظر را با درج یک فاصله وارد کنید`\n_after this command type_ *Target ID*", true)
end
elseif msg.text:find("/sendtoall") and msg.chat.id == admingp then
local usertarget = msg.text:input()
if usertarget then
i=0
for k,v in pairs(users) do
i=i+1
send_key(tonumber(k), usertarget, keyboard)
end
return send_msg(admingp, "`پیام شما به "..i.." نفر ارسال شد`\n_yor message_ *Sent to "..i.."* _people_", true)
else
return send_msg(admingp, "`بعد از این دستور پیام خود را وارد کنید`\n_after this command type_ *Your Message*", true)
end
elseif msg.text == "/contact" or msg.text:lower() == "my contact" or msg.text == "شماره من" then
return send_phone(msg.from.id, "+"..sudo_num, sudo_name)
elseif msg.text == "/users" and msg.chat.id == admingp then
local list = ""
i=0
for k,v in pairs(users) do
i=i+1
list = list..i.."- *"..k.."*\n"
end
return send_msg(admingp, "*Users list:\n\n*"..list, true)
elseif msg.text == "/blocklist>" and msg.chat.id == admingp then
local list = {{"/key"}}
for k,v in pairs(blocks) do
if v then
table.insert(list, {"/unblock "..k})
end
end
return send_key(admingp, "*For unblock select a item:*", list, true)
elseif msg.text == "/blocklist" and msg.chat.id == admingp then
local list = ""
i=0
for k,v in pairs(blocks) do
if v then
i=i+1
list = list..i.."- *"..k.."*\n"
end
end
return send_msg(admingp, "*Block list:\n\n*"..list, true)
elseif msg.text == "/friends>" and msg.chat.id == admingp then
local list = {{"/key"}}
for k,v in pairs(admins) do
if v then
table.insert(list, {"/demote "..k})
end
end
return send_key(admingp, "*For demote a friends select a item:*", list, true)
elseif msg.text == "/friends" and msg.chat.id == admingp then
local list = ""
i=0
for k,v in pairs(admins) do
if v then
i=i+1
list = list..i.."- *"..k.."*\n"
end
end
return send_msg(admingp, "*Friends list:\n\n*"..list, true)
elseif msg.text == "/req>" and msg.chat.id == admingp then
local list = {{"/key"}}
for k,v in pairs(requests) do
if v then
table.insert(list, {"/chat"..k,"/del"..k,"/block"..k})
end
end
return send_key(admingp, "*For accept or delete request select a item:*", list, true)
elseif msg.text == "/req" or msg.text:lower() == "chat request" or msg.text == "ارسال درخواست چت" then
if msg.chat.id == admingp then
local list = ""
i=0
for k,v in pairs(requests) do
if v then
i=i+1
list = list..i.."- *"..k.."*\n"
end
end
return send_msg(admingp, "*Request list:\n\n*"..list, true)
else
if requests[userid] then
return send_msg(msg.from.id, "`شما قبلا درخواست ارسال کردید، منتظر باشید رسیدگی شود`\n_You have_ *Open Request* _please wait_", true)
elseif msg.from.id == chats.id then
return send_msg(msg.from.id, "`!!باشه بهش میگم!!`", true)
else
requests[userid] = true
save_data("requests.json", requests)
send_msg(msg.from.id, "`درخواست شما ارسال شد، منتظر بمانید`\n_You'r request_ *Sent*, _please wait_", true)
local text = "شما از مشخصات زیر درخواست چت دارید:\nYou have chat request of this user:\n\n"
.."Name: "..(msg.from.first_name or "").." "..(msg.from.last_name or "").."\nUser: @"..(msg.from.username or "-----").."\nID: "..msg.from.id.."\n\n"
--.."برای پزیرش گزینه ی اول را ارسال کنید، برای رد گزینه ی دوم را و برای بلاک کردن گزینه ی سوم را:\nfor accept press first option or for delete request press option 2 and for block user, press option 3:\n\n"
.."1- /chat"..msg.from.id.."\n\n2- /del"..msg.from.id.."\n\n3- /block"..msg.from.id
if not msg.from.username then
send_fwrd(admingp, msg.from.id, msg.message_id)
end
return send_msg(admingp, text, false)
end
end
elseif msg.text == '/sms' or msg.text:lower() == "send sms" or msg.text == "ارسال پیامک به من" then
if admins[userid] then
if msg.reply_to_message then
if msg.reply_to_message.from.id == bot.id then
return send_msg(msg.from.id, "`این دستور یا دستور /sms را با یک پیام متنی ریپلی کنید`\n*Reply* _this command or_ /sms _on a message_", true)
end
if msg.reply_to_message.text == false or msg.reply_to_message.text == nil or msg.reply_to_message.text == "" or msg.reply_to_message.text == " " then
return send_msg(admingp, "`فقط قادر به ارسال پیام متنی میباشید.`", true)
end
if string.len (msg.reply_to_message.text) > 150 then
return send_msg(msg.from.id, "`این دستور یا دستور /sms را با یک پیام متنی ریپلی کنید`\n_You'r message_ *Sent*, _don't send again_", true)
end
send_sms("00"..sudo_num, "[@"..(msg.from.username or "-----").."] ("..msg.from.id..")\n\n"..msg.reply_to_message.text)
return send_msg(msg.from.id, "`پیام شما ارسال شد، از ارسال مجدد خودداری کنید`\n_You'r message_ *Sent*, _don't send again_", true)
else
return send_msg(msg.from.id, "`این دستور یا دستور /sms را با یک پیام متنی ریپلی کنید`\n*Reply* _this command or_ /sms _on a message_", true)
end
else
return send_msg(msg.from.id, "`شما از دوستان نیستید و امکان استفاده از این سرویس را ندارید`\n_You are_ *Not My Friend* _and you not allow for use this command_", true)
end
elseif msg.text == "/key" and msg.chat.id == admingp then
adminkey = {{"/end","/help","/block"},{"/req>","/req","/users"},{"/blocklist>","/blocklist"},{"/friends>","/friends"}}
return send_key(admingp, "*Admin Keyboard:*", adminkey, true)
elseif msg.reply_to_message and msg.text == "/avatar" and msg.chat.id == admingp then
if msg.reply_to_message.photo then
local i = #msg.reply_to_message.photo
local photo_file = msg.reply_to_message.photo[i].file_id
local url = send_api.."/getFile?file_id="..photo_file
local file = https.request(url)
local file = json.decode(file)
local url = "https://api.telegram.org/file/bot"..bot_token.."/"..file.result.file_path
local file = https.request(url)
f = io.open("./avatar.webp", "w+")
f:write(file)
f:close()
return send_msg(admingp, "`آواتار شما ذخیره شد`\n_You'r avatar_ *Saved*", true)
end
elseif msg.text:find("/info") or msg.text:lower() == "my info" or msg.text == "بیوگرافی من" then
if msg.chat.id == admingp then
local usertarget = msg.text:input()
if usertarget then
local file = io.open("./about.txt", "w")
file:write(usertarget)
file:flush()
file:close()
return send_msg(admingp, "`مطلب مورد نظر درباره ی شما ذخیره شد`\n_You'r information_ *Saved*", true)
else
return send_msg(admingp, "`بعد از این دستور مطالب مورد نظر راجبه خود را وارد کنید`\n_after this command type_ *Your Information*", true)
end
else
local f = io.open("./about.txt")
if f then
s = f:read('*all')
f:close()
infotxts = "`بیوگرافی:`\n"..s.."\n\n"
else
infotxts = ""
end
bioinfo = infotxts.."*Name:* "..sudo_name.."\n*Username:* [@"..sudo_user.."](https://telegram.me/"..sudo_user..")\n*Mobile:* +"..sudo_num.."\n*Telegram ID:* "..sudo_id.."\n*Channel:* [@"..sudo_ch.."](https://telegram.me/"..sudo_ch..")\n\n_Powered by_ [TELESTRIKE](https://telegram.me/TeleStRiKe)"
send_msg(msg.chat.id, bioinfo, true)
local f = io.open("./avatar.webp")
if f then
send_document(msg.chat.id, "./avatar.webp")
end
return
end
elseif msg.text:find('/promote') and msg.chat.id == admingp then
local usertarget = msg.text:input()
if usertarget then
if blocks[tostring(usertarget)] then
return send_msg(admingp, "`شخص مورد نظر بلاک است`\n_You'r target are_ *Block*", true)
end
admins[tostring(usertarget)] = true
save_data("admins.json", admins)
send_msg(tonumber(usertarget), "`شما به عنوان دوست برگزیده انتخاب شدید`\n_You promoted to_ *Best Friend*", true)
return send_msg(admingp, "`شخص مورد نظر به عنوان دوست صمیمی انتخاب شد`\n_You'r target promoted to_ *Best Friend*", true)
else
return send_msg(admingp, "`بعد از این دستور آی دی شخص مورد نظر را با درج یک فاصله وارد کنید`\n_after this command type_ *Target ID*", true)
end
elseif msg.text:find('/demote') and msg.chat.id == admingp then
local usertarget = msg.text:input()
if usertarget then
if blocks[tostring(usertarget)] then
return send_msg(admingp, "`شخص مورد نظر بلاک است`\n_You'r target are_ *Block*", true)
end
admins[tostring(usertarget)] = false
save_data("admins.json", admins)
send_msg(tonumber(usertarget), "`شما دیگر دوست صمیمی نیستید`\n_You demoted of_ *Best Friend*", true)
return send_msg(admingp, "`شخص مورد نظر دیگر دوست صمیمی نیست`\n_You'r target demoted of_ *Best Friend*", true)
else
return send_msg(admingp, "`بعد از این دستور آی دی شخص مورد نظر را با درج یک فاصله وارد کنید`\n_after this command type_ *Target ID*", true)
end
elseif msg.text:find('/block') and msg.chat.id == admingp then
local usertarget = msg.text:input()
if usertarget then
if tonumber(usertarget) == sudo_id or tonumber(usertarget) == bot.id then
return send_msg(admingp, "`نمیتوانید خودتان را بلاک کنید`\n_You can't block_ *You'r Self*", true)
end
if blocks[tostring(usertarget)] then
return send_msg(admingp, "`شخص مورد نظر بلاک است`\n_You'r target are_ *Block*", true)
end
blocks[tostring(usertarget)] = true
save_data("blocks.json", blocks)
send_msg(tonumber(usertarget), "`شما بلاک شدید!`\n_You are_ *Blocked!*", true)
send_msg(admingp, "`شخص مورد نظر بلاک شد`\n_You'r target_ *Blocked*", true)
if requests[tostring(usertarget)] then
requests[tostring(usertarget)] = false
save_data("requests.json", requests)
send_msg(tonumber(usertarget), "`درخواست چت شما رد شد`\n_You'r chat request_ *Deleted*", true)
send_msg(admingp, "`درخواست چت شخص مورد نظر رد شد`\n_You'r target chat request_ *Deleted*", true)
elseif chats.id == tonumber(usertarget) then
chats.id = 0
save_data("chats.json", chats)
send_msg(tonumber(usertarget), "`چت بسته شد`\n_You'r chatroom_ *Closed*", true)
send_msg(admingp, "`چت بسته شد`\n_You'r chatroom_ *Closed*", true)
end
return
else
if chats.id > 0 then
blocks[tostring(chats.id)] = true
save_data("blocks.json", blocks)
send_msg(chats.id, "`شما بلاک شدید!`\n_You are_ *Blocked!*", true)
send_msg(admingp, "`شخص مورد نظر بلاک شد`\n_You'r target_ *Blocked*", true)
chats.id = 0
save_data("chats.json", chats)
send_msg(chats.id, "`چت بسته شد`\n_You'r chatroom_ *Closed*", true)
return send_msg(admingp, "`چت بسته شد`\n_You'r chatroom_ *Closed*", true)
else
if msg.text == "/block" then
return send_msg(admingp, "`بعد از این دستور آی دی شخص مورد نظر را با درج یک فاصله وارد کنید`\n_after this command type_ *Target ID*", true)
else
local usertarget = msg.text:gsub("/block","")
if tonumber(usertarget) == sudo_id or tonumber(usertarget) == bot.id then
return send_msg(admingp, "`نمیتوانید خودتان را بلاک کنید`\n_You can't block_ *You'r Self*", true)
end
if blocks[tostring(usertarget)] then
return send_msg(admingp, "`شخص مورد نظر بلاک است`\n_You'r target are_ *Block*", true)
end
blocks[tostring(usertarget)] = true
save_data("blocks.json", blocks)
send_msg(tonumber(usertarget), "`شما بلاک شدید!`\n_You are_ *Blocked!*", true)
send_msg(admingp, "`شخص مورد نظر بلاک شد`\n_You'r target_ *Blocked*", true)
if requests[tostring(usertarget)] then
requests[tostring(usertarget)] = false
save_data("requests.json", requests)
send_msg(tonumber(usertarget), "`درخواست چت شما رد شد`\n_You'r chat request_ *Deleted*", true)
send_msg(admingp, "`درخواست چت شخص مورد نظر رد شد`\n_You'r target chat request_ *Deleted*", true)
elseif chats.id == tonumber(usertarget) then
chats.id = 0
save_data("chats.json", chats)
send_msg(tonumber(usertarget), "`چت بسته شد`\n_You'r chatroom_ *Closed*", true)
send_msg(admingp, "`چت بسته شد`\n_You'r chatroom_ *Closed*", true)
end
return
end
end
end
elseif msg.text:find('/unblock') and msg.chat.id == admingp then
local usertarget = msg.text:input()
if usertarget then
if blocks[tostring(usertarget)] then
blocks[tostring(usertarget)] = false
save_data("blocks.json", blocks)
send_msg(tonumber(usertarget), "`شما آنبلاک شدید!`\n_You are_ *Unblocked!*", true)
return send_msg(admingp, "`شخص مورد نظر آنبلاک شد`\n_You'r target_ *Unblocked*", true)
end
return send_msg(admingp, "`شخص مورد نظر بلاک نیست`\n_You target_ *Not Block*", true)
else
return send_msg(admingp, "`بعد از این دستور آی دی شخص مورد نظر را با درج یک فاصله وارد کنید`\n_after this command type_ *Target ID*", true)
end
elseif msg.text:find('/del') and msg.chat.id == admingp then
local usertarget = msg.text:input()
if usertarget then
if requests[tostring(usertarget)] then
requests[tostring(usertarget)] = false
save_data("requests.json", requests)
send_msg(tonumber(usertarget), "`درخواست چت شما رد شد`\n_You'r chat request_ *Deleted*", true)
return send_msg(admingp, "`درخواست چت شخص مورد نظر رد شد`\n_You'r target chat request_ *Deleted*", true)
else
return send_msg(admingp, "`درخواستی از شخص مورد نظر وجود ندارد`\n_You'r target_ *Have Not* _chat request_", true)
end
else
if msg.text == "/del" then
return send_msg(admingp, "`بعد از این دستور آی دی شخص مورد نظر را با درج یک فاصله وارد کنید`\n_after this command type_ *Target ID*", true)
else
local usertarget = msg.text:gsub("/del","")
if requests[tostring(usertarget)] then
requests[tostring(usertarget)] = false
save_data("requests.json", requests)
send_msg(tonumber(usertarget), "`درخواست چت شما رد شد`\n_You'r chat request_ *Deleted*", true)
return send_msg(admingp, "`درخواست چت شخص مورد نظر رد شد`\n_You'r target chat request_ *Deleted*", true)
else
return send_msg(admingp, "`درخواستی از شخص مورد نظر وجود ندارد`\n_You'r target_ *Have Not* _chat request_", true)
end
end
end
elseif msg.text:find('/chat') and msg.chat.id == admingp then
if chats.id > 0 then
return send_msg(admingp, "`شما چت باز دارید، اول آن را ببندید`\n_You have_ *Open Chat*, _first send_ /end", true)
end
local usertarget = msg.text:input()
if usertarget then
if blocks[tostring(usertarget)] then
return send_msg(admingp, "`شخص مورد نظر بلاک است`\n_You'r target are_ *Block*", true)
end
requests[tostring(usertarget)] = false
save_data("requests.json", requests)
chats.id = tonumber(usertarget)
save_data("chats.json", chats)
send_msg(tonumber(usertarget), "`چت آغاز شد، میتوانید گپ زدن را شروع کنید`\n_Chat_ *Started*", true)
return send_msg(admingp, "`چت آغاز شد`\n_Chat_ *Started*", true)
else
if msg.text == "/chat" then
return send_msg(admingp, "`بعد از این دستور آی دی شخص مورد نظر را با درج یک فاصله وارد کنید`\n_after this command type_ *Target ID*", true)
else
local usertarget = msg.text:gsub("/chat","")
if blocks[tostring(usertarget)] then
return send_msg(admingp, "`شخص مورد نظر بلاک است`\n_You'r target are_ *Block*", true)
end
requests[tostring(usertarget)] = false
save_data("requests.json", requests)
chats.id = tonumber(usertarget)
save_data("chats.json", chats)
send_msg(tonumber(usertarget), "`چت آغاز شد، میتوانید گپ زدن را شروع کنید`\n_Chat_ *Started*", true)
return send_msg(admingp, "`چت آغاز شد`\n_Chat_ *Started*", true)
end
end
elseif msg.text == "/end" and msg.chat.id == admingp then
if chats.id == 0 then
return send_msg(admingp, "`چت باز موجود نیست`\n_You haven't_ *Open Chat*", true)
end
send_msg(admingp, "`چت با "..chats.id.." بسته شد`\n_Chat with "..chats.id.."_ *Closed*", true)
send_msg(chats.id, "`چت بسته شد`\n_Chat_ *Closed*", true)
chats.id = 0
save_data("chats.json", chats)
return
elseif msg.text == "/help" or msg.text:lower() == "help" or msg.text == "راهنما" then
if msg.chat.id == admingp then
return send_msg(admingp, help_sudo, true)
else
return send_inline(msg.chat.id, about_txt, about_key)
end
elseif msg.text == "/about" or msg.text:lower() == "about v"..bot_version or msg.text == "ربات نسخه"..bot_version then
return send_inline(msg.chat.id, about_txt, about_key)
end
---------------------------------------------------------------------------------------------------------------------------------------------------
if msg.chat.id == admingp and chats.id > 0 then
return send_fwrd(chats.id, msg.chat.id, msg.message_id)
elseif msg.chat.id == admingp and chats.id == 0 then
return send_msg(admingp, "`چت باز موجود نیست`\n_You haven't_ *Open Chat*", true)
end
if msg.from.id == chats.id then
return send_fwrd(admingp, msg.from.id, msg.message_id)
else
if requests[tostring(msg.from.id)] then
return send_msg(msg.from.id, "`منتظر بمانید تا درخواست چت شما تایید شود`\n_Please wait for_ "..sudo_name.." *Accept You*", true)
else
return send_msg(msg.from.id, "`اول درخواست چت ارسال کنید`\n_First send_ *chat request* _with_ /req", true)
end
end
end
function inline(msg)
thumb = "http://umbrella.shayan-soft.ir/inline_icons/"
local f = io.open("./about.txt")
if f then
s = f:read('*all')
f:close()
infotxtin = "`بیوگرافی:\n`"..s.."\n\n"
else
infotxtin = ""
end
bioinfo = infotxtin.."*Name:* "..sudo_name.."\n*Username:* [@"..sudo_user.."](https://telegram.me/"..sudo_user..")\n*Mobile:* +"..sudo_num.."\n*Telegram ID:* "..sudo_id.."\n*Channel:* [@"..sudo_ch.."](https://telegram.me/"..sudo_ch..")\n\n_Powered by_ [TELESTRIKE](https://telegram.me/TeleStRiKe)"
tabless = '[{"text":"اکانت اصلی من","url":"https://telegram.me/'..sudo_user..'"}],[{"text":"کانال شخصی من","url":"https://telegram.me/'..sudo_ch..'"}],[{"text":"کانال سازنده","url":"https://telegram.me/TeleStRiKe"},{"text":"سازنده ربات","url":"https://telegram.me/SuDoTMstRiKe"}]'
info_inline = '{"type":"article","parse_mode":"Markdown","id":"2","title":"بیوگرافی من","description":"هر آنچه درباره من باید بدانید...","message_text":"'..bioinfo..'","thumb_url":"'..thumb..'pv_bio.png","reply_markup":{"inline_keyboard":['..tabless..']}}'
phone_inline = '{"type":"contact","id":"1","phone_number":"'..sudo_num..'","first_name":"'..sudo_name..'","last_name":"","thumb_url":"'..thumb..'pv_phone.png"},'
return send_req(send_api.."/answerInlineQuery?inline_query_id="..msg.id.."&is_personal=true&cache_time=1&results="..url.escape('['..phone_inline..info_inline..']'))
end
return {launch = run, inline = inline}