-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvite.py
108 lines (94 loc) · 3.56 KB
/
invite.py
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
:
print(f"""
░▄▀▀░▀█▀░▄▀▄░▀▄▀▒▄▀▄░█▄▀░░░█▄▒▄█▒▄▀▄░█▄▀░▄▀▀▒▄▀▄
▒▄██░▒█▒░▀▄▀░▒█▒░█▀█░█▒█▒░░█▒▀▒█░█▀█░█▒█▒▄██░█▀█
by @NAKATIKA_NAEBUKA
""")
cpass = configparser.RawConfigParser()
cpass.read('config.data')
try:
api_id = cpass['cred']['id']
api_hash = cpass['cred']['hash']
phone = cpass['cred']['phone']
client = TelegramClient(phone, api_id, api_hash)
except KeyError:
os.system('clear')
banner()
print(re+"[!] run python3 setup.py first !!\n")
sys.exit(1)
client.connect()
if not client.is_user_authorized():
client.send_code_request(phone)
os.system('clear')
banner()
client.sign_in(phone, input(gr+'[+] Хуйника код: '+re))
os.system('clear')
banner()
input_file = sys.argv[1]
users = []
with open(input_file, encoding='UTF-8') as f:
rows = csv.reader(f,delimiter=",",lineterminator="\n")
next(rows, None)
for row in rows:
user = {}
user['username'] = row[0]
user['id'] = int(row[1])
user['access_hash'] = int(row[2])
user['name'] = row[3]
users.append(user)
chats = []
last_date = None
chunk_size = 200
groups=[]
result = client(GetDialogsRequest(
offset_date=last_date,
offset_id=0,
offset_peer=InputPeerEmpty(),
limit=chunk_size,
hash = 0
))
chats.extend(result.chats)
for chat in chats:
try:
if chat.megagroup== True:
groups.append(chat)
except:
continue
i=0
for group in groups:
print(gr+'['+cy+str(i)+gr+']'+cy+' - '+group.title)
i+=1
print(gr+'[+] Выберите группу для добавления Петухов')
g_index = input(gr+"[+] Введите номер : "+re)
target_group=groups[int(g_index)]
target_group_entity = InputPeerChannel(target_group.id,target_group.access_hash)
print(gr+"[1] Подтянуть Петуха за залупу (по ID)\n[2] Подтянуть Петуха за волосы (по имени).")
mode = int(input(gr+"Input : "+re))
n = 0
print(users)
print('before for')
for user in users:
n += 1
if 1 == 1:
time.sleep(1)
try:
print ("Adding {}".format(user['id']))
if mode == 1:
if user['username'] == "":
continue
user_to_add = client.get_input_entity(user['username'])
elif mode == 2:
user_to_add = InputPeerUser(user['id'], user['access_hash'])
else:
sys.exit(re+"[!] Выбран хуйпонятный режим. пожалуйста, попробуйте снова.")
client(InviteToChannelRequest(target_group_entity,[user_to_add]))
print(gr+"[+] Не выебывайся где-то 10-30 секунд...")
time.sleep(random.randrange(10, 30))
except PeerFloodError:
print(re+"[!] Получаю Пиздюлей от telegram. \n[!] Сценарий сейчас останавливается. \n[!] Пожалуйста, повторите попытку через некоторое время.")
except UserPrivacyRestrictedError:
print(re+"[!] Настройки конфиденциальности Петуха не позволяют вам этого делать. Ложим хуй.")
except:
traceback.print_exc()
print(re+"[!] Непредвиденная ошибка")
continue