forked from SidraELEzz/Telegram-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
143 lines (109 loc) · 5.66 KB
/
main.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
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
import requests,user_agent,json,flask,telebot,random,os,sys
import telebot
from telebot import types
from user_agent import generate_user_agent
import logging
from config import *
from flask import Flask, request
bot = telebot.TeleBot(BOT_TOKEN)
server = Flask(__name__)
logger = telebot.logger
logger.setLevel(logging.DEBUG)
@bot.message_handler(commands=['start'])
def boten(message):
mas = types.InlineKeyboardMarkup(row_width=2)
A = types.InlineKeyboardButton(text ="USER (BFFFL)", callback_data="F1")
E = types.InlineKeyboardButton(text ="USER (BFFF2)", callback_data="F2")
M = types.InlineKeyboardButton('المطور', url='https://t.me/SidraTools')
mas.add(A,E,M)
bot.send_message(message.chat.id, f"- أهلاً بكً !\n\n- بوت تشكير يوزرات تلجرام 🧑💻\n\n♻️ لوحة التحكم الخاصه بك ♨️",reply_markup=mas)
@bot.callback_query_handler(func=lambda call: True)
def masg(call):
global nam
if call.data =="SidraTools":
mas = types.InlineKeyboardMarkup(row_width=2)
A = types.InlineKeyboardButton(text ="USER (BFFFL)", callback_data="F1")
E = types.InlineKeyboardButton(text ="USER (BFFF2)", callback_data="F2")
M = types.InlineKeyboardButton('المطور', url='https://t.me/SidraTools')
M = types.InlineKeyboardButton('المطور', url='https://t.me/SidraTools')
bot.edit_message_text(chat_id=call.message.chat.id,message_id=call.message.message_id, text="- أهلاً بكً عزيزي المستخدم \n\n- بوت تشكير يوزرات تلجرام 🧑💻\n\n♻️ لوحة التحكم الخاصه بك ♨️",reply_markup=mas)
elif call.data =="F1":
xu = "MNBVCXZLKJHGFDSAPOIUYTREWQ"
xn = "MNBVCXZLKJHGFDSAPOIUYTREWQ"
xa = "MNBVCXZLKJHGFDSAPOIUYTREWQ"
ok=0
cp=0
sk=0
while True:
us = str(''.join(random.choice(xu)for i in range(1)))
un = str(''.join(random.choice(xn)for i in range(1)))
ua = str(''.join(random.choice(xa)for i in range(1)))
username = str(us)+str(un)+str(un)+str(un)+str(ua)
url = "https://t.me/"+str(username)
headers = {
"User-Agent": generate_user_agent(),
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language" : "ar-EG,ar;q=0.9,en-US;q=0.8,en;q=0.7"}
response = requests.get(url, headers=headers)
if response.text.find('If you have <strong>Telegram</strong>, you can contact <a class="tgme_username_link"')>=0:
ok+=1
sk+=1
bot.send_message(call.message.chat.id,f"‹ ᴜѕᴇʀɴᴀᴍᴇ ᴛᴇʟᴇɢʀᴀᴍ ✓\n────── • ✧✧ • ──────\n‹ ᴜѕᴇʀɴᴀᴍᴇ : @{username}\n────── • ✧✧ • ──────\n• @SidraTools")
else:
cp+=1
sk+=1
mas = types.InlineKeyboardMarkup(row_width=2)
A = types.InlineKeyboardButton(f'GOOD : {ok}',callback_data="1x")
E = types.InlineKeyboardButton(f'EROR : {cp}', callback_data="1x")
B = types.InlineKeyboardButton(f'{username}', callback_data="1x")
R = types.InlineKeyboardButton(f'{sk}', callback_data="1x")
M = types.InlineKeyboardButton('المطور', url='https://t.me/SidraTools')
mas.add(A,E,B,R,M)
bot.edit_message_text(chat_id=call.message.chat.id,message_id=call.message.message_id,text="ok start",reply_markup=mas)
elif call.data =="F2":
xu = "MNBVCXZLKJHGFDSAPOIUYTREWQ"
xn = "MNBVCXZLKJHGFDSAPOIUYTREWQ"
xa = "MNBVCXZLKJHGFDSAPOIUYTREWQ"
xm = "0987654321"
ok=0
cp=0
sk=0
while True:
us = str(''.join(random.choice(xu)for i in range(1)))
un = str(''.join(random.choice(xn)for i in range(1)))
ua = str(''.join(random.choice(xa)for i in range(1)))
bs = str(''.join(random.choice(xm)for i in range(1)))
username = str(us)+str(un)+str(un)+str(un)+str(bs)
url = "https://t.me/"+str(username)
headers = {
"User-Agent": generate_user_agent(),
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language" : "ar-EG,ar;q=0.9,en-US;q=0.8,en;q=0.7"}
response = requests.get(url, headers=headers)
if response.text.find('If you have <strong>Telegram</strong>, you can contact <a class="tgme_username_link"')>=0:
ok+=1
sk+=1
bot.send_message(call.message.chat.id,f"‹ ᴜѕᴇʀɴᴀᴍᴇ ᴛᴇʟᴇɢʀᴀᴍ ✓\n────── • ✧✧ • ──────\n‹ ᴜѕᴇʀɴᴀᴍᴇ : @{username}\n────── • ✧✧ • ──────\n• @SidraTools")
else:
cp+=1
sk+=1
mas = types.InlineKeyboardMarkup(row_width=2)
A = types.InlineKeyboardButton(f'GOOD : {ok}', callback_data="1x")
E = types.InlineKeyboardButton(f'EROR : {cp}', callback_data="1x")
B = types.InlineKeyboardButton(f'{username}', callback_data="1x")
R = types.InlineKeyboardButton(f'{sk}', callback_data="1x")
M = types.InlineKeyboardButton('المطور', url='https://t.me/SidraTools')
mas.add(A,E,B,R,M)
bot.edit_message_text(chat_id=call.message.chat.id,message_id=call.message.message_id,text="ok start",reply_markup=mas)
@server.route(f"/{BOT_TOKEN}", methods=["POST"])
def redirect_message():
json_string = request.get_data().decode("utf-8")
update = telebot.types.Update.de_json(json_string)
bot.process_new_updates([update])
return "!", 200
if __name__ == "__main__":
bot.remove_webhook()
bot.set_webhook(url="https://sidrabot.herokuapp.com/"+str(BOT_TOKEN))
server.run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)))