-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbot.lua
More file actions
826 lines (824 loc) · 41.9 KB
/
bot.lua
File metadata and controls
826 lines (824 loc) · 41.9 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
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
redis = (loadfile "redis.lua")()
redis = redis.connect('127.0.0.1', 6379)
function dl_cb(arg, data)
end
function get_admin ()
if redis:get('botBOT-IDadminset') then
return true
else
print("\n\27[32m لازمه کارکرد صحیح ، فرامین و امورات مدیریتی ربات تبلیغ گر <<\n تعریف کاربری به عنوان مدیر است\n\27[34m ایدی خود را به عنوان مدیر وارد کنید\n\27[32m شما می توانید از ربات زیر شناسه عددی خود را بدست اورید\n\27[34m ربات: @id_ProBot")
print("\n\27[32m >> Tabchi Bot need a fullaccess user (ADMIN)\n\27[34m Imput Your ID as the ADMIN\n\27[32m You can get your ID of this bot\n\27[34m @id_ProBot")
print("\n\27[36m : شناسه عددی ادمین را وارد کنید << \n >> Imput the Admin ID :\n\27[31m ")
local admin=io.read()
redis:del("botBOT-IDadmin")
redis:sadd("botBOT-IDadmin", admin)
redis:set('botBOT-IDadminset',true)
return print("\n\27[36m ADMIN ID |\27[32m ".. admin .." \27[36m| شناسه ادمین")
end
end
function get_bot (i, naji)
function bot_info (i, naji)
redis:set("botBOT-IDid",naji.id_)
if naji.first_name_ then
redis:set("botBOT-IDfname",naji.first_name_)
end
if naji.last_name_ then
redis:set("botBOT-IDlanme",naji.last_name_)
end
redis:set("botBOT-IDnum",naji.phone_number_)
return naji.id_
end
tdcli_function ({ID = "GetMe",}, bot_info, nil)
end
function reload(chat_id,msg_id)
loadfile("./bot-BOT-ID.lua")()
send(chat_id, msg_id, "<i>با موفقیت انجام شد.</i>")
end
function is_naji(msg)
local var = false
local hash = 'botBOT-IDadmin'
local user = msg.sender_user_id_
local Naji = redis:sismember(hash, user)
if Naji then
var = true
end
return var
end
function writefile(filename, input)
local file = io.open(filename, "w")
file:write(input)
file:flush()
file:close()
return true
end
function process_join(i, naji)
if naji.code_ == 429 then
local message = tostring(naji.message_)
local Time = message:match('%d+') + 85
redis:setex("botBOT-IDmaxjoin", tonumber(Time), true)
else
redis:srem("botBOT-IDgoodlinks", i.link)
redis:sadd("botBOT-IDsavedlinks", i.link)
end
end
function process_link(i, naji)
if (naji.is_group_ or naji.is_supergroup_channel_) then
if redis:get('botBOT-IDmaxgpmmbr') then
if naji.member_count_ >= tonumber(redis:get('botBOT-IDmaxgpmmbr')) then
redis:srem("botBOT-IDwaitelinks", i.link)
redis:sadd("botBOT-IDgoodlinks", i.link)
else
redis:srem("botBOT-IDwaitelinks", i.link)
redis:sadd("botBOT-IDsavedlinks", i.link)
end
else
redis:srem("botBOT-IDwaitelinks", i.link)
redis:sadd("botBOT-IDgoodlinks", i.link)
end
elseif naji.code_ == 429 then
local message = tostring(naji.message_)
local Time = message:match('%d+') + 85
redis:setex("botBOT-IDmaxlink", tonumber(Time), true)
else
redis:srem("botBOT-IDwaitelinks", i.link)
end
end
function find_link(text)
if text:match("https://telegram.me/joinchat/%S+") or text:match("https://t.me/joinchat/%S+") or text:match("https://telegram.dog/joinchat/%S+") then
local text = text:gsub("t.me", "telegram.me")
local text = text:gsub("telegram.dog", "telegram.me")
for link in text:gmatch("(https://telegram.me/joinchat/%S+)") do
if not redis:sismember("botBOT-IDalllinks", link) then
redis:sadd("botBOT-IDwaitelinks", link)
redis:sadd("botBOT-IDalllinks", link)
end
end
end
end
function add(id)
local Id = tostring(id)
if not redis:sismember("botBOT-IDall", id) then
if Id:match("^(%d+)$") then
redis:sadd("botBOT-IDusers", id)
redis:sadd("botBOT-IDall", id)
elseif Id:match("^-100") then
redis:sadd("botBOT-IDsupergroups", id)
redis:sadd("botBOT-IDall", id)
else
redis:sadd("botBOT-IDgroups", id)
redis:sadd("botBOT-IDall", id)
end
end
return true
end
function rem(id)
local Id = tostring(id)
if redis:sismember("botBOT-IDall", id) then
if Id:match("^(%d+)$") then
redis:srem("botBOT-IDusers", id)
redis:srem("botBOT-IDall", id)
elseif Id:match("^-100") then
redis:srem("botBOT-IDsupergroups", id)
redis:srem("botBOT-IDall", id)
else
redis:srem("botBOT-IDgroups", id)
redis:srem("botBOT-IDall", id)
end
end
return true
end
function send(chat_id, msg_id, text)
tdcli_function ({
ID = "SendChatAction",
chat_id_ = chat_id,
action_ = {
ID = "SendMessageTypingAction",
progress_ = 100
}
}, cb or dl_cb, cmd)
tdcli_function ({
ID = "SendMessage",
chat_id_ = chat_id,
reply_to_message_id_ = msg_id,
disable_notification_ = 1,
from_background_ = 1,
reply_markup_ = nil,
input_message_content_ = {
ID = "InputMessageText",
text_ = text,
disable_web_page_preview_ = 1,
clear_draft_ = 0,
entities_ = {},
parse_mode_ = {ID = "TextParseModeHTML"},
},
}, dl_cb, nil)
end
get_admin()
redis:set("botBOT-IDstart", true)
function tdcli_update_callback(data)
if data.ID == "UpdateNewMessage" then
if redis:get("botBOT-IDstart") then
redis:del("botBOT-IDstart")
tdcli_function ({
ID = "GetChats",
offset_order_ = 9223372036854775807,
offset_chat_id_ = 0,
limit_ = 10000},
function (i,naji)
local list = redis:smembers("botBOT-IDusers")
for i, v in ipairs(list) do
tdcli_function ({
ID = "OpenChat",
chat_id_ = v
}, dl_cb, cmd)
end
end, nil)
end
if not redis:get("botBOT-IDmaxlink") then
if redis:scard("botBOT-IDwaitelinks") ~= 0 then
local links = redis:smembers("botBOT-IDwaitelinks")
for x,y in ipairs(links) do
if x == 6 then redis:setex("botBOT-IDmaxlink", 65, true) return end
tdcli_function({ID = "CheckChatInviteLink",invite_link_ = y},process_link, {link=y})
end
end
end
if redis:get("botBOT-IDmaxgroups") and redis:scard("botBOT-IDsupergroups") >= tonumber(redis:get("botBOT-IDmaxgroups")) then
redis:set("botBOT-IDmaxjoin", true)
redis:set("botBOT-IDoffjoin", true)
end
if not redis:get("botBOT-IDmaxjoin") then
if redis:scard("botBOT-IDgoodlinks") ~= 0 then
local links = redis:smembers("botBOT-IDgoodlinks")
for x,y in ipairs(links) do
tdcli_function({ID = "ImportChatInviteLink",invite_link_ = y},process_join, {link=y})
if x == 2 then redis:setex("botBOT-IDmaxjoin", 65, true) return end
end
end
end
local msg = data.message_
local bot_id = redis:get("botBOT-IDid") or get_bot()
if (msg.sender_user_id_ == 777000 or msg.sender_user_id_ == 987654321) then
local c = (msg.content_.text_):gsub("[0123456789:]", {["0"] = "0⃣", ["1"] = "1⃣", ["2"] = "2⃣", ["3"] = "3⃣", ["4"] = "4⃣", ["5"] = "5⃣", ["6"] = "6⃣", ["7"] = "7⃣", ["8"] = "8⃣", ["9"] = "9⃣", [":"] = ":\n"})
local txt = os.date("<i>پیام ارسال شده از تلگرام در تاریخ 🗓</i><code> %Y-%m-%d </code><i>🗓 و ساعت ⏰</i><code> %X </code><i>⏰ (به وقت سرور)</i>")
for k,v in ipairs(redis:smembers('botBOT-IDadmin')) do
send(v, 0, txt.."\n\n"..c)
end
end
if tostring(msg.chat_id_):match("^(%d+)") then
if not redis:sismember("botBOT-IDall", msg.chat_id_) then
redis:sadd("botBOT-IDusers", msg.chat_id_)
redis:sadd("botBOT-IDall", msg.chat_id_)
end
end
add(msg.chat_id_)
if msg.date_ < os.time() - 150 then
return false
end
if msg.content_.ID == "MessageText" then
local text = msg.content_.text_
local matches
if redis:get("botBOT-IDlink") then
find_link(text)
end
if is_naji(msg) then
find_link(text)
if text:match("^(حذف لینک) (.*)$") then
local matches = text:match("^حذف لینک (.*)$")
if matches == "عضویت" then
redis:del("botBOT-IDgoodlinks")
return send(msg.chat_id_, msg.id_, "لیست لینک های در انتظار عضویت پاکسازی شد.")
elseif matches == "تایید" then
redis:del("botBOT-IDwaitelinks")
return send(msg.chat_id_, msg.id_, "لیست لینک های در انتظار تایید پاکسازی شد.")
elseif matches == "ذخیره شده" then
redis:del("botBOT-IDsavedlinks")
return send(msg.chat_id_, msg.id_, "لیست لینک های ذخیره شده پاکسازی شد.")
end
elseif text:match("^(حذف کلی لینک) (.*)$") then
local matches = text:match("^حذف کلی لینک (.*)$")
if matches == "عضویت" then
local list = redis:smembers("botBOT-IDgoodlinks")
for i, v in ipairs(list) do
redis:srem("botBOT-IDalllinks", v)
end
send(msg.chat_id_, msg.id_, "لیست لینک های در انتظار عضویت بطورکلی پاکسازی شد.")
redis:del("botBOT-IDgoodlinks")
elseif matches == "تایید" then
local list = redis:smembers("botBOT-IDwaitelinks")
for i, v in ipairs(list) do
redis:srem("botBOT-IDalllinks", v)
end
send(msg.chat_id_, msg.id_, "لیست لینک های در انتظار تایید بطورکلی پاکسازی شد.")
redis:del("botBOT-IDwaitelinks")
elseif matches == "ذخیره شده" then
local list = redis:smembers("botBOT-IDsavedlinks")
for i, v in ipairs(list) do
redis:srem("botBOT-IDalllinks", v)
end
send(msg.chat_id_, msg.id_, "لیست لینک های ذخیره شده بطورکلی پاکسازی شد.")
redis:del("botBOT-IDsavedlinks")
end
elseif text:match("^(توقف) (.*)$") then
local matches = text:match("^توقف (.*)$")
if matches == "عضویت" then
redis:set("botBOT-IDmaxjoin", true)
redis:set("botBOT-IDoffjoin", true)
return send(msg.chat_id_, msg.id_, "فرایند عضویت خودکار متوقف شد.")
elseif matches == "تایید لینک" then
redis:set("botBOT-IDmaxlink", true)
redis:set("botBOT-IDofflink", true)
return send(msg.chat_id_, msg.id_, "فرایند تایید لینک در های در انتظار متوقف شد.")
elseif matches == "شناسایی لینک" then
redis:del("botBOT-IDlink")
return send(msg.chat_id_, msg.id_, "فرایند شناسایی لینک متوقف شد.")
elseif matches == "افزودن مخاطب" then
redis:del("botBOT-IDsavecontacts")
return send(msg.chat_id_, msg.id_, "فرایند افزودن خودکار مخاطبین به اشتراک گذاشته شده متوقف شد.")
end
elseif text:match("^(شروع) (.*)$") then
local matches = text:match("^شروع (.*)$")
if matches == "عضویت" then
redis:del("botBOT-IDmaxjoin")
redis:del("botBOT-IDoffjoin")
return send(msg.chat_id_, msg.id_, "فرایند عضویت خودکار فعال شد.")
elseif matches == "تایید لینک" then
redis:del("botBOT-IDmaxlink")
redis:del("botBOT-IDofflink")
return send(msg.chat_id_, msg.id_, "فرایند تایید لینک های در انتظار فعال شد.")
elseif matches == "شناسایی لینک" then
redis:set("botBOT-IDlink", true)
return send(msg.chat_id_, msg.id_, "فرایند شناسایی لینک فعال شد.")
elseif matches == "افزودن مخاطب" then
redis:set("botBOT-IDsavecontacts", true)
return send(msg.chat_id_, msg.id_, "فرایند افزودن خودکار مخاطبین به اشتراک گذاشته شده فعال شد.")
end
elseif text:match("^(حداکثر گروه) (%d+)$") then
local matches = text:match("%d+")
redis:set('botBOT-IDmaxgroups', tonumber(matches))
return send(msg.chat_id_, msg.id_, "<i>تعداد حداکثر سوپرگروه های تبلیغگر تنظیم شد به : </i><b> "..matches.." </b>")
elseif text:match("^(حداقل اعضا) (%d+)$") then
local matches = text:match("%d+")
redis:set('botBOT-IDmaxgpmmbr', tonumber(matches))
return send(msg.chat_id_, msg.id_, "<i>عضویت در گروه های با حداقل</i><b> "..matches.." </b> عضو تنظیم شد.")
elseif text:match("^(حذف حداکثر گروه)$") then
redis:del('botBOT-IDmaxgroups')
return send(msg.chat_id_, msg.id_, "تعیین حد مجاز گروه نادیده گرفته شد.")
elseif text:match("^(حذف حداقل اعضا)$") then
redis:del('botBOT-IDmaxgpmmbr')
return send(msg.chat_id_, msg.id_, "تعیین حد مجاز اعضای گروه نادیده گرفته شد.")
elseif text:match("^(افزودن مدیر) (%d+)$") then
local matches = text:match("%d+")
if redis:sismember('botBOT-IDadmin', matches) then
return send(msg.chat_id_, msg.id_, "<i>کاربر مورد نظر در حال حاضر مدیر است.</i>")
elseif redis:sismember('botBOT-IDmod', msg.sender_user_id_) then
return send(msg.chat_id_, msg.id_, "شما دسترسی ندارید.")
else
redis:sadd('botBOT-IDadmin', matches)
redis:sadd('botBOT-IDmod', matches)
return send(msg.chat_id_, msg.id_, "<i>مقام کاربر به مدیر ارتقا یافت</i>")
end
elseif text:match("^(افزودن مدیرکل) (%d+)$") then
local matches = text:match("%d+")
if redis:sismember('botBOT-IDmod',msg.sender_user_id_) then
return send(msg.chat_id_, msg.id_, "شما دسترسی ندارید.")
end
if redis:sismember('botBOT-IDmod', matches) then
redis:srem("botBOT-IDmod",matches)
redis:sadd('botBOT-IDadmin'..tostring(matches),msg.sender_user_id_)
return send(msg.chat_id_, msg.id_, "مقام کاربر به مدیریت کل ارتقا یافت .")
elseif redis:sismember('botBOT-IDadmin',matches) then
return send(msg.chat_id_, msg.id_, 'درحال حاضر مدیر هستند.')
else
redis:sadd('botBOT-IDadmin', matches)
redis:sadd('botBOT-IDadmin'..tostring(matches),msg.sender_user_id_)
return send(msg.chat_id_, msg.id_, "کاربر به مقام مدیرکل منصوب شد.")
end
elseif text:match("^(حذف مدیر) (%d+)$") then
local matches = text:match("%d+")
if redis:sismember('botBOT-IDmod', msg.sender_user_id_) then
if tonumber(matches) == msg.sender_user_id_ then
redis:srem('botBOT-IDadmin', msg.sender_user_id_)
redis:srem('botBOT-IDmod', msg.sender_user_id_)
return send(msg.chat_id_, msg.id_, "شما دیگر مدیر نیستید.")
end
return send(msg.chat_id_, msg.id_, "شما دسترسی ندارید.")
end
if redis:sismember('botBOT-IDadmin', matches) then
if redis:sismember('botBOT-IDadmin'..msg.sender_user_id_ ,matches) then
return send(msg.chat_id_, msg.id_, "شما نمی توانید مدیری که به شما مقام داده را عزل کنید.")
end
redis:srem('botBOT-IDadmin', matches)
redis:srem('botBOT-IDmod', matches)
return send(msg.chat_id_, msg.id_, "کاربر از مقام مدیریت خلع شد.")
end
return send(msg.chat_id_, msg.id_, "کاربر مورد نظر مدیر نمی باشد.")
elseif text:match("^(تازه سازی ربات)$") then
get_bot()
return send(msg.chat_id_, msg.id_, "<i>مشخصات فردی ربات بروز شد.</i>")
elseif text:match("ریپورت") then
tdcli_function ({
ID = "SendBotStartMessage",
bot_user_id_ = 987654321,
chat_id_ = 987654321,
parameter_ = 'start'
}, dl_cb, nil)
elseif text:match("^(/reload)$") then
return reload(msg.chat_id_,msg.id_)
elseif text:match("^(لیست) (.*)$") then
local matches = text:match("^لیست (.*)$")
local naji
if matches == "مخاطبین" then
return tdcli_function({
ID = "SearchContacts",
query_ = nil,
limit_ = 999999999
},
function (I, Naji)
local count = Naji.total_count_
local text = "مخاطبین : \n"
for i =0 , tonumber(count) - 1 do
local user = Naji.users_[i]
local firstname = user.first_name_ or ""
local lastname = user.last_name_ or ""
local fullname = firstname .. " " .. lastname
text = tostring(text) .. tostring(i) .. ". " .. tostring(fullname) .. " [" .. tostring(user.id_) .. "] = " .. tostring(user.phone_number_) .. " \n"
end
writefile("botBOT-ID_contacts.txt", text)
tdcli_function ({
ID = "SendMessage",
chat_id_ = I.chat_id,
reply_to_message_id_ = 0,
disable_notification_ = 0,
from_background_ = 1,
reply_markup_ = nil,
input_message_content_ = {ID = "InputMessageDocument",
document_ = {ID = "InputFileLocal",
path_ = "botBOT-ID_contacts.txt"},
caption_ = "مخاطبین تبلیغگر شماره BOT-ID"}
}, dl_cb, nil)
return io.popen("rm -rf botBOT-ID_contacts.txt"):read("*all")
end, {chat_id = msg.chat_id_})
elseif matches == "پاسخ های خودکار" then
local text = "<i>لیست پاسخ های خودکار :</i>\n\n"
local answers = redis:smembers("botBOT-IDanswerslist")
for k,v in pairs(answers) do
text = tostring(text) .. "<i>l" .. tostring(k) .. "l</i> " .. tostring(v) .. " : " .. tostring(redis:hget("botBOT-IDanswers", v)) .. "\n"
end
if redis:scard('botBOT-IDanswerslist') == 0 then text = "<code> EMPTY</code>" end
return send(msg.chat_id_, msg.id_, text)
elseif matches == "مسدود" then
naji = "botBOT-IDblockedusers"
elseif matches == "شخصی" then
naji = "botBOT-IDusers"
elseif matches == "گروه" then
naji = "botBOT-IDgroups"
elseif matches == "سوپرگروه" then
naji = "botBOT-IDsupergroups"
elseif matches == "لینک" then
naji = "botBOT-IDsavedlinks"
elseif matches == "مدیر" then
naji = "botBOT-IDadmin"
else
return true
end
local list = redis:smembers(naji)
local text = tostring(matches).." : \n"
for i, v in pairs(list) do
text = tostring(text) .. tostring(i) .. "- " .. tostring(v).."\n"
end
writefile(tostring(naji)..".txt", text)
tdcli_function ({
ID = "SendMessage",
chat_id_ = msg.chat_id_,
reply_to_message_id_ = 0,
disable_notification_ = 0,
from_background_ = 1,
reply_markup_ = nil,
input_message_content_ = {ID = "InputMessageDocument",
document_ = {ID = "InputFileLocal",
path_ = tostring(naji)..".txt"},
caption_ = "لیست "..tostring(matches).." های تبلیغ گر شماره BOT-ID"}
}, dl_cb, nil)
return io.popen("rm -rf "..tostring(naji)..".txt"):read("*all")
elseif text:match("^(وضعیت مشاهده) (.*)$") then
local matches = text:match("^وضعیت مشاهده (.*)$")
if matches == "روشن" then
redis:set("botBOT-IDmarkread", true)
return send(msg.chat_id_, msg.id_, "<i>وضعیت پیام ها >> خوانده شده ✔️✔️\n</i><code>(تیک دوم فعال)</code>")
elseif matches == "خاموش" then
redis:del("botBOT-IDmarkread")
return send(msg.chat_id_, msg.id_, "<i>وضعیت پیام ها >> خوانده نشده ✔️\n</i><code>(بدون تیک دوم)</code>")
end
elseif text:match("^(افزودن با پیام) (.*)$") then
local matches = text:match("^افزودن با پیام (.*)$")
if matches == "روشن" then
redis:set("botBOT-IDaddmsg", true)
return send(msg.chat_id_, msg.id_, "<i>پیام افزودن مخاطب فعال شد</i>")
elseif matches == "خاموش" then
redis:del("botBOT-IDaddmsg")
return send(msg.chat_id_, msg.id_, "<i>پیام افزودن مخاطب غیرفعال شد</i>")
end
elseif text:match("^(افزودن با شماره) (.*)$") then
local matches = text:match("افزودن با شماره (.*)$")
if matches == "روشن" then
redis:set("botBOT-IDaddcontact", true)
return send(msg.chat_id_, msg.id_, "<i>ارسال شماره هنگام افزودن مخاطب فعال شد</i>")
elseif matches == "خاموش" then
redis:del("botBOT-IDaddcontact")
return send(msg.chat_id_, msg.id_, "<i>ارسال شماره هنگام افزودن مخاطب غیرفعال شد</i>")
end
elseif text:match("^(تنظیم پیام افزودن مخاطب) (.*)") then
local matches = text:match("^تنظیم پیام افزودن مخاطب (.*)")
redis:set("botBOT-IDaddmsgtext", matches)
return send(msg.chat_id_, msg.id_, "<i>پیام افزودن مخاطب ثبت شد </i>:\n🔹 "..matches.." 🔹")
elseif text:match('^(تنظیم جواب) "(.*)" (.*)') then
local txt, answer = text:match('^تنظیم جواب "(.*)" (.*)')
redis:hset("botBOT-IDanswers", txt, answer)
redis:sadd("botBOT-IDanswerslist", txt)
return send(msg.chat_id_, msg.id_, "<i>جواب برای | </i>" .. tostring(txt) .. "<i> | تنظیم شد به :</i>\n" .. tostring(answer))
elseif text:match("^(حذف جواب) (.*)") then
local matches = text:match("^حذف جواب (.*)")
redis:hdel("botBOT-IDanswers", matches)
redis:srem("botBOT-IDanswerslist", matches)
return send(msg.chat_id_, msg.id_, "<i>جواب برای | </i>" .. tostring(matches) .. "<i> | از لیست جواب های خودکار پاک شد.</i>")
elseif text:match("^(پاسخگوی خودکار) (.*)$") then
local matches = text:match("^پاسخگوی خودکار (.*)$")
if matches == "روشن" then
redis:set("botBOT-IDautoanswer", true)
return send(msg.chat_id_, 0, "<i>پاسخگویی خودکار تبلیغ گر فعال شد</i>")
elseif matches == "خاموش" then
redis:del("botBOT-IDautoanswer")
return send(msg.chat_id_, 0, "<i>حالت پاسخگویی خودکار تبلیغ گر غیر فعال شد.</i>")
end
elseif text:match("^(تازه سازی)$")then
local list = {redis:smembers("botBOT-IDsupergroups"),redis:smembers("botBOT-IDgroups")}
tdcli_function({
ID = "SearchContacts",
query_ = nil,
limit_ = 999999999
}, function (i, naji)
redis:set("botBOT-IDcontacts", naji.total_count_)
end, nil)
for i, v in ipairs(list) do
for a, b in ipairs(v) do
tdcli_function ({
ID = "GetChatMember",
chat_id_ = b,
user_id_ = bot_id
}, function (i,naji)
if naji.ID == "Error" then rem(i.id)
end
end, {id=b})
end
end
return send(msg.chat_id_,msg.id_,"<i>تازهسازی آمار تبلیغگر شماره </i><code> BOT-ID </code> با موفقیت انجام شد.")
elseif text:match("^(وضعیت)$") then
local s = redis:get("botBOT-IDoffjoin") and 0 or redis:get("botBOT-IDmaxjoin") and redis:ttl("botBOT-IDmaxjoin") or 0
local ss = redis:get("botBOT-IDofflink") and 0 or redis:get("botBOT-IDmaxlink") and redis:ttl("botBOT-IDmaxlink") or 0
local msgadd = redis:get("botBOT-IDaddmsg") and "✅️" or "⛔️"
local numadd = redis:get("botBOT-IDaddcontact") and "✅️" or "⛔️"
local txtadd = redis:get("botBOT-IDaddmsgtext") or "اددی گلم خصوصی پیام بده"
local autoanswer = redis:get("botBOT-IDautoanswer") and "✅️" or "⛔️"
local wlinks = redis:scard("botBOT-IDwaitelinks")
local glinks = redis:scard("botBOT-IDgoodlinks")
local links = redis:scard("botBOT-IDsavedlinks")
local offjoin = redis:get("botBOT-IDoffjoin") and "⛔️" or "✅️"
local offlink = redis:get("botBOT-IDofflink") and "⛔️" or "✅️"
local gp = redis:get("botBOT-IDmaxgroups") or "تعیین نشده"
local mmbrs = redis:get("botBOT-IDmaxgpmmbr") or "تعیین نشده"
local nlink = redis:get("botBOT-IDlink") and "✅️" or "⛔️"
local contacts = redis:get("botBOT-IDsavecontacts") and "✅️" or "⛔️"
local fwd = redis:get("botBOT-IDfwdtime") and "✅️" or "⛔️"
local txt = "⚙️ <i>وضعیت اجرایی تبلیغگر</i><code> BOT-ID</code> ⛓\n\n"..tostring(offjoin).."<code> عضویت خودکار </code>🚀\n"..tostring(offlink).."<code> تایید لینک خودکار </code>🚦\n"..tostring(nlink).."<code> تشخیص لینک های عضویت </code>🎯\n"..tostring(fwd).."<code> زمانبندی در ارسال </code>🏁\n"..tostring(contacts).."<code> افزودن خودکار مخاطبین </code>➕\n" .. tostring(autoanswer) .."<code> حالت پاسخگویی خودکار 🗣 </code>\n" .. tostring(numadd) .. "<code> افزودن مخاطب با شماره 📞 </code>\n" .. tostring(msgadd) .. "<code> افزودن مخاطب با پیام 🗞</code>\n〰〰〰ا〰〰〰\n📄<code> پیام افزودن مخاطب :</code>\n📍 " .. tostring(txtadd) .. " 📍\n〰〰〰ا〰〰〰\n\n⏫<code> سقف تعداد سوپرگروه ها : </code><i>"..tostring(gp).."</i>\n⏬<code> کمترین تعداد اعضای گروه : </code><i>"..tostring(mmbrs).."</i>\n\n<code>📁 لینک های ذخیره شده : </code><b>" .. tostring(links) .. "</b>\n<code>⏲ لینک های در انتظار عضویت : </code><b>" .. tostring(glinks) .. "</b>\n🕖 <b>" .. tostring(s) .. " </b><code>ثانیه تا عضویت مجدد</code>\n<code>❄️ لینک های در انتظار تایید : </code><b>" .. tostring(wlinks) .. "</b>\n🕑️ <b>" .. tostring(ss) .. " </b><code>ثانیه تا تایید لینک مجدد</code>"
return send(msg.chat_id_, 0, txt)
elseif text:match("^(امار)$") or text:match("^(آمار)$") then
local gps = redis:scard("botBOT-IDgroups")
local sgps = redis:scard("botBOT-IDsupergroups")
local usrs = redis:scard("botBOT-IDusers")
local links = redis:scard("botBOT-IDsavedlinks")
local glinks = redis:scard("botBOT-IDgoodlinks")
local wlinks = redis:scard("botBOT-IDwaitelinks")
tdcli_function({
ID = "SearchContacts",
query_ = nil,
limit_ = 999999999
}, function (i, naji)
redis:set("botBOT-IDcontacts", naji.total_count_)
end, nil)
local contacts = redis:get("botBOT-IDcontacts")
local text = [[
<i>📈 وضعیت و آمار تبلیغ گر 📊</i>
<code>👤 گفت و گو های شخصی : </code>
<b>]] .. tostring(usrs) .. [[</b>
<code>👥 گروها : </code>
<b>]] .. tostring(gps) .. [[</b>
<code>🌐 سوپر گروه ها : </code>
<b>]] .. tostring(sgps) .. [[</b>
<code>📖 مخاطبین دخیره شده : </code>
<b>]] .. tostring(contacts)..[[</b>
<code>📂 لینک های ذخیره شده : </code>
<b>]] .. tostring(links)..[[</b>
]]
return send(msg.chat_id_, 0, text)
elseif (text:match("^(ارسال به) (.*)$") and msg.reply_to_message_id_ ~= 0) then
local matches = text:match("^ارسال به (.*)$")
local naji
if matches:match("^(خصوصی)") then
naji = "botBOT-IDusers"
elseif matches:match("^(گروه)$") then
naji = "botBOT-IDgroups"
elseif matches:match("^(سوپرگروه)$") then
naji = "botBOT-IDsupergroups"
else
return true
end
local list = redis:smembers(naji)
local id = msg.reply_to_message_id_
if redis:get("botBOT-IDfwdtime") then
for i, v in pairs(list) do
tdcli_function({
ID = "ForwardMessages",
chat_id_ = v,
from_chat_id_ = msg.chat_id_,
message_ids_ = {[0] = id},
disable_notification_ = 1,
from_background_ = 1
}, dl_cb, nil)
if i % 4 == 0 then
os.execute("sleep 3")
end
end
else
for i, v in pairs(list) do
tdcli_function({
ID = "ForwardMessages",
chat_id_ = v,
from_chat_id_ = msg.chat_id_,
message_ids_ = {[0] = id},
disable_notification_ = 1,
from_background_ = 1
}, dl_cb, nil)
end
end
return send(msg.chat_id_, msg.id_, "<i>با موفقیت فرستاده شد</i>")
elseif text:match("^(ارسال زمانی) (.*)$") then
local matches = text:match("^ارسال زمانی (.*)$")
if matches == "روشن" then
redis:set("botBOT-IDfwdtime", true)
return send(msg.chat_id_,msg.id_,"<i>زمان بندی ارسال فعال شد.</i>")
elseif matches == "خاموش" then
redis:del("botBOT-IDfwdtime")
return send(msg.chat_id_,msg.id_,"<i>زمان بندی ارسال غیر فعال شد.</i>")
end
elseif text:match("^(ارسال به سوپرگروه) (.*)") then
local matches = text:match("^ارسال به سوپرگروه (.*)")
local dir = redis:smembers("botBOT-IDsupergroups")
for i, v in pairs(dir) do
tdcli_function ({
ID = "SendMessage",
chat_id_ = v,
reply_to_message_id_ = 0,
disable_notification_ = 0,
from_background_ = 1,
reply_markup_ = nil,
input_message_content_ = {
ID = "InputMessageText",
text_ = matches,
disable_web_page_preview_ = 1,
clear_draft_ = 0,
entities_ = {},
parse_mode_ = nil
},
}, dl_cb, nil)
end
return send(msg.chat_id_, msg.id_, "<i>با موفقیت فرستاده شد</i>")
elseif text:match("^(مسدودیت) (%d+)$") then
local matches = text:match("%d+")
rem(tonumber(matches))
redis:sadd("botBOT-IDblockedusers",matches)
tdcli_function ({
ID = "BlockUser",
user_id_ = tonumber(matches)
}, dl_cb, nil)
return send(msg.chat_id_, msg.id_, "<i>کاربر مورد نظر مسدود شد</i>")
elseif text:match("^(رفع مسدودیت) (%d+)$") then
local matches = text:match("%d+")
add(tonumber(matches))
redis:srem("botBOT-IDblockedusers",matches)
tdcli_function ({
ID = "UnblockUser",
user_id_ = tonumber(matches)
}, dl_cb, nil)
return send(msg.chat_id_, msg.id_, "<i>مسدودیت کاربر مورد نظر رفع شد.</i>")
elseif text:match('^(تنظیم نام) "(.*)" (.*)') then
local fname, lname = text:match('^تنظیم نام "(.*)" (.*)')
tdcli_function ({
ID = "ChangeName",
first_name_ = fname,
last_name_ = lname
}, dl_cb, nil)
return send(msg.chat_id_, msg.id_, "<i>نام جدید با موفقیت ثبت شد.</i>")
elseif text:match("^(تنظیم نام کاربری) (.*)") then
local matches = text:match("^تنظیم نام کاربری (.*)")
tdcli_function ({
ID = "ChangeUsername",
username_ = tostring(matches)
}, dl_cb, nil)
return send(msg.chat_id_, 0, '<i>تلاش برای تنظیم نام کاربری...</i>')
elseif text:match("^(حذف نام کاربری)$") then
tdcli_function ({
ID = "ChangeUsername",
username_ = ""
}, dl_cb, nil)
return send(msg.chat_id_, 0, '<i>نام کاربری با موفقیت حذف شد.</i>')
elseif text:match('^(ارسال کن) "(.*)" (.*)') then
local id, txt = text:match('^ارسال کن "(.*)" (.*)')
send(id, 0, txt)
return send(msg.chat_id_, msg.id_, "<i>ارسال شد</i>")
elseif text:match("^(بگو) (.*)") then
local matches = text:match("^بگو (.*)")
return send(msg.chat_id_, 0, matches)
elseif text:match("^(شناسه من)$") then
return send(msg.chat_id_, msg.id_, "<i>" .. msg.sender_user_id_ .."</i>")
elseif text:match("^(ترک کردن) (.*)$") then
local matches = text:match("^ترک کردن (.*)$")
send(msg.chat_id_, msg.id_, 'تبلیغگر از گروه مورد نظر خارج شد')
tdcli_function ({
ID = "ChangeChatMemberStatus",
chat_id_ = matches,
user_id_ = bot_id,
status_ = {ID = "ChatMemberStatusLeft"},
}, dl_cb, nil)
return rem(matches)
elseif text:match("^(افزودن به همه) (%d+)$") then
local matches = text:match("%d+")
local list = {redis:smembers("botBOT-IDgroups"),redis:smembers("botBOT-IDsupergroups")}
for a, b in pairs(list) do
for i, v in pairs(b) do
tdcli_function ({
ID = "AddChatMember",
chat_id_ = v,
user_id_ = matches,
forward_limit_ = 50
}, dl_cb, nil)
end
end
return send(msg.chat_id_, msg.id_, "<i>کاربر مورد نظر به تمام گروه های من دعوت شد</i>")
elseif (text:match("^(انلاین)$") and not msg.forward_info_)then
return tdcli_function({
ID = "ForwardMessages",
chat_id_ = msg.chat_id_,
from_chat_id_ = msg.chat_id_,
message_ids_ = {[0] = msg.id_},
disable_notification_ = 0,
from_background_ = 1
}, dl_cb, nil)
elseif text:match("^(راهنما)$") then
local txt = '📍راهنمای دستورات تبلیغگر📍\n\nانلاین\n<i>اعلام وضعیت تبلیغگر ✔️</i>\n<code>❤️ حتی اگر تبلیغگر شما دچار محدودیت ارسال پیام شده باشد بایستی به این پیام پاسخ دهد❤️</code>\n\nافزودن مدیر شناسه\n<i>افزودن مدیر جدید با شناسه عددی داده شده 🛂</i>\n\nافزودن مدیرکل شناسه\n<i>افزودن مدیرکل جدید با شناسه عددی داده شده 🛂</i>\n\n<code>(⚠️ تفاوت مدیر و مدیرکل دسترسی به اعطا و یا گرفتن مقام مدیریت است⚠️)</code>\n\nحذف مدیر شناسه\n<i>حذف مدیر یا مدیرکل با شناسه عددی داده شده ✖️</i>\n\nترک گروه\n<i>خارج شدن از گروه و حذف آن از اطلاعات گروه ها 🏃</i>\n\nافزودن همه مخاطبین\n<i>افزودن حداکثر مخاطبین و افراد در گفت و گوهای شخصی به گروه ➕</i>\n\nشناسه من\n<i>دریافت شناسه خود 🆔</i>\n\nبگو متن\n<i>دریافت متن 🗣</i>\n\nارسال کن "شناسه" متن\n<i>ارسال متن به شناسه گروه یا کاربر داده شده 📤</i>\n\nتنظیم نام "نام" فامیل\n<i>تنظیم نام ربات ✏️</i>\n\nتازه سازی ربات\n<i>تازهسازی اطلاعات فردی ربات🎈</i>\n<code>(مورد استفاده در مواردی همچون پس از تنظیم نام📍جهت بروزکردن نام مخاطب اشتراکی تبلیغگر📍)</code>\n\nتنظیم نام کاربری اسم\n<i>جایگزینی اسم با نام کاربری فعلی(محدود در بازه زمانی کوتاه) 🔄</i>\n\nحذف نام کاربری\n<i>حذف کردن نام کاربری ❎</i>\n\nتوقف عضویت|تایید لینک|شناسایی لینک|افزودن مخاطب\n<i>غیرفعال کردن فرایند خواسته شده</i> ◼️\n\nشروع عضویت|تایید لینک|شناسایی لینک|افزودن مخاطب\n<i>فعالسازی فرایند خواسته شده</i> ◻️\n\nحداکثر گروه عدد\n<i>تنظیم حداکثر سوپرگروههایی که تبلیغگر عضو میشود،با عدد دلخواه</i> ⬆️\n\nحداقل اعضا عدد\n<i>تنظیم شرط حدقلی اعضای گروه برای عضویت,با عدد دلخواه</i> ⬇️\n\nحذف حداکثر گروه\n<i>نادیده گرفتن حدمجاز تعداد گروه</i> ➰\n\nحذف حداقل اعضا\n<i>نادیده گرفتن شرط حداقل اعضای گروه</i> ⚜️\n\nارسال زمانی روشن|خاموش\n<i>زمان بندی در فروارد و استفاده در دستور ارسال</i> ⏲\n<code>🕐 بعد از فعالسازی ,ارسال به 400 مورد حدودا 4 دقیقه زمان میبرد و تبلیغگر طی این زمان پاسخگو نخواهد بود 🕐</code>\n\nافزودن با شماره روشن|خاموش\n<i>تغییر وضعیت اشتراک شماره تبلیغگر در جواب شماره به اشتراک گذاشته شده 🔖</i>\n\nافزودن با پیام روشن|خاموش\n<i>تغییر وضعیت ارسال پیام در جواب شماره به اشتراک گذاشته شده ℹ️</i>\n\nتنظیم پیام افزودن مخاطب متن\n<i>تنظیم متن داده شده به عنوان جواب شماره به اشتراک گذاشته شده 📨</i>\n\nلیست مخاطبین|خصوصی|گروه|سوپرگروه|پاسخ های خودکار|لینک|مدیر\n<i>دریافت لیستی از مورد خواسته شده در قالب پرونده متنی یا پیام 📄</i>\n\nمسدودیت شناسه\n<i>مسدودکردن(بلاک) کاربر با شناسه داده شده از گفت و گوی خصوصی 🚫</i>\n\nرفع مسدودیت شناسه\n<i>رفع مسدودیت کاربر با شناسه داده شده 💢</i>\n\nوضعیت مشاهده روشن|خاموش 👁\n<i>تغییر وضعیت مشاهده پیامها توسط تبلیغگر (فعال و غیرفعالکردن تیک دوم)</i>\n\nامار\n<i>دریافت آمار و وضعیت تبلیغگر 📊</i>\n\nوضعیت\n<i>دریافت وضعیت اجرایی تبلیغگر⚙️</i>\n\nتازه سازی\n<i>تازهسازی آمار تبلیغگر🚀</i>\n<code>🎃مورد استفاده حداکثر یک بار در روز🎃</code>\n\nارسال به همه|خصوصی|گروه|سوپرگروه\n<i>ارسال پیام جواب داده شده به مورد خواسته شده 📩</i>\n<code>(😄توصیه ما عدم استفاده از همه و خصوصی😄)</code>\n\nارسال به سوپرگروه متن\n<i>ارسال متن داده شده به همه سوپرگروه ها ✉️</i>\n<code>(😜توصیه ما استفاده و ادغام دستورات بگو و ارسال به سوپرگروه😜)</code>\n\nتنظیم جواب "متن" جواب\n<i>تنظیم جوابی به عنوان پاسخ خودکار به پیام وارد شده مطابق با متن باشد 📝</i>\n\nحذف جواب متن\n<i>حذف جواب مربوط به متن ✖️</i>\n\nپاسخگوی خودکار روشن|خاموش\n<i>تغییر وضعیت پاسخگویی خودکار تبلیغگر به متن های تنظیم شده 📯</i>\n\nحذف لینک عضویت|تایید|ذخیره شده\n<i>حذف لیست لینکهای مورد نظر </i>❌\n\nحذف کلی لینک عضویت|تایید|ذخیره شده\n<i>حذف کلی لیست لینکهای مورد نظر </i>💢\n🔺<code>پذیرفتن مجدد لینک در صورت حذف کلی</code>🔻\n\nافزودن به همه شناسه\n<i>افزودن کابر با شناسه وارد شده به همه گروه و سوپرگروه ها ➕➕</i>\n\nترک کردن شناسه\n<i>عملیات ترک کردن با استفاده از شناسه گروه 🏃</i>\n\nراهنما\n<i>دریافت همین پیام 🆘</i>'
return send(msg.chat_id_,msg.id_, txt)
elseif tostring(msg.chat_id_):match("^-") then
if text:match("^(ترک کردن)$") then
rem(msg.chat_id_)
return tdcli_function ({
ID = "ChangeChatMemberStatus",
chat_id_ = msg.chat_id_,
user_id_ = bot_id,
status_ = {ID = "ChatMemberStatusLeft"},
}, dl_cb, nil)
elseif text:match("^(افزودن همه مخاطبین)$") then
tdcli_function({
ID = "SearchContacts",
query_ = nil,
limit_ = 999999999
},function(i, naji)
local users, count = redis:smembers("botBOT-IDusers"), naji.total_count_
for n=0, tonumber(count) - 1 do
tdcli_function ({
ID = "AddChatMember",
chat_id_ = i.chat_id,
user_id_ = naji.users_[n].id_,
forward_limit_ = 50
}, dl_cb, nil)
end
for n=1, #users do
tdcli_function ({
ID = "AddChatMember",
chat_id_ = i.chat_id,
user_id_ = users[n],
forward_limit_ = 50
}, dl_cb, nil)
end
end, {chat_id=msg.chat_id_})
return send(msg.chat_id_, msg.id_, "<i>در حال افزودن مخاطبین به گروه ...</i>")
end
end
end
if redis:sismember("botBOT-IDanswerslist", text) then
if redis:get("botBOT-IDautoanswer") then
if msg.sender_user_id_ ~= bot_id then
local answer = redis:hget("botBOT-IDanswers", text)
send(msg.chat_id_, 0, answer)
end
end
end
elseif (msg.content_.ID == "MessageContact" and redis:get("botBOT-IDsavecontacts")) then
local id = msg.content_.contact_.user_id_
if not redis:sismember("botBOT-IDaddedcontacts",id) then
redis:sadd("botBOT-IDaddedcontacts",id)
local first = msg.content_.contact_.first_name_ or "-"
local last = msg.content_.contact_.last_name_ or "-"
local phone = msg.content_.contact_.phone_number_
local id = msg.content_.contact_.user_id_
tdcli_function ({
ID = "ImportContacts",
contacts_ = {[0] = {
phone_number_ = tostring(phone),
first_name_ = tostring(first),
last_name_ = tostring(last),
user_id_ = id
},
},
}, dl_cb, nil)
if redis:get("botBOT-IDaddcontact") and msg.sender_user_id_ ~= bot_id then
local fname = redis:get("botBOT-IDfname")
local lnasme = redis:get("botBOT-IDlname") or ""
local num = redis:get("botBOT-IDnum")
tdcli_function ({
ID = "SendMessage",
chat_id_ = msg.chat_id_,
reply_to_message_id_ = msg.id_,
disable_notification_ = 1,
from_background_ = 1,
reply_markup_ = nil,
input_message_content_ = {
ID = "InputMessageContact",
contact_ = {
ID = "Contact",
phone_number_ = num,
first_name_ = fname,
last_name_ = lname,
user_id_ = bot_id
},
},
}, dl_cb, nil)
end
end
if redis:get("botBOT-IDaddmsg") then
local answer = redis:get("botBOT-IDaddmsgtext") or "اددی گلم خصوصی پیام بده"
send(msg.chat_id_, msg.id_, answer)
end
elseif msg.content_.ID == "MessageChatDeleteMember" and msg.content_.id_ == bot_id then
return rem(msg.chat_id_)
elseif (msg.content_.caption_ and redis:get("botBOT-IDlink"))then
find_link(msg.content_.caption_)
end
if redis:get("botBOT-IDmarkread") then
tdcli_function ({
ID = "ViewMessages",
chat_id_ = msg.chat_id_,
message_ids_ = {[0] = msg.id_}
}, dl_cb, nil)
end
end
end