-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
87 lines (74 loc) · 2.51 KB
/
app.py
File metadata and controls
87 lines (74 loc) · 2.51 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
#!/usr/bin/env python3
## TELEGRAM PROFILER BOT
## BY SlavPH
## IMPORTS
import telebot
import time
import sys
import csv
## LOCKER
status = False
def lock():
global status
status = True
def unlock():
global status
status = False
## TELEGRAM PROFILER FUNCTION
def Telegram(cid):
directories = [
'newaa','newab','newac','newad','newae','newaf','newag','newah',
'newai','newag','newak','newal','newam','newan','newao','newap',
'newaq','newar','newas','newat','newau','newav','newaw','newax',
'neway','newaz','newba','newbb','newbc','newbd','newbe','newbf',
'newbg','newbh','newbi','newbj','newbk','newbl','newbm','newbn',
'newbo','newbp','newbq','newbr','newbs','newbt','newbu','newbv'
]
for directory in directories:
with open(directory, 'r') as data:
csvreader = csv.reader(data)
for row in csvreader:
if row[0] == cid:
return row[1]
break
## DEFINING BOT
Token = "Your-Token-Here"
bot = telebot.TeleBot(Token)
## START COMMAND
@bot.message_handler(commands=['start'])
def start_command(message):
user = message.from_user.first_name
bot.send_chat_action(message.chat.id, "typing")
bot.reply_to(message, f"Hello {user}! Send Chat-ID")
## PING COMMAND
@bot.message_handler(commands=['ping'])
def start_command(message):
bot.send_chat_action(message.chat.id, "typing")
bot.reply_to(message, "Running perfectly")
## MESSAGE HANDLER
@bot.message_handler(func = lambda message: message.text.isnumeric())
def all_handler(message):
global status
if status == False:
cid = message.text.strip()
msg1 = bot.reply_to(message, "[+] Fetching... It can take up to a minute!")
try:
lock()
result = Telegram(cid)
if result == None:
bot.edit_message_text(text="[+] Target not found", chat_id=message.chat.id, message_id=msg1.message_id)
unlock()
else:
bot.edit_message_text(text=f"""
-> id = {cid}
-> Number = +{result}
""", chat_id=message.chat.id, message_id=msg1.message_id)
unlock()
except:
bot.edit_message_text(text="[+] Process failed! Do it again.", chat_id=message.chat.id, message_id=msg1.message_id)
unlock()
else:
bot.send_chat_action(message.chat.id, "typing")
bot.reply_to(message, "Another user is using this process!")
## RUN THE BOT
bot.infinity_polling(skip_pending=True)