-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSource Spam Sms ( Free ) (1).py
229 lines (171 loc) · 6.53 KB
/
Source Spam Sms ( Free ) (1).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
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
import telebot
import bs4, base64
import os
import subprocess
import psutil
import sqlite3
import hashlib
import threading
import time
import requests
import datetime
api_bot = "6578917837:AAE_aFNfulvYw3clA94XZigAG0jdBQJZ48Y" #Nhập api Bot Của Telegram
processes = []
bot = telebot.TeleBot(api_bot)
allowed_users = []
ADMIN_ID = 5884057707 # id Admin để sử dụng quyền hành
Group_Id_Chat = -1002170354953 # Lấy Id Group Mà Bạn Muốn Bot Hoạt Động Trên Đó
connection = sqlite3.connect('user_data.db')
cursor = connection.cursor()
# Tạo bảng người dùng nếu chưa tồn tại
cursor.execute('''
CREATE TABLE IF NOT EXISTS users (
user_id INTEGER PRIMARY KEY,
expiration_time TEXT
)
''')
connection.commit()
def TimeStamp():
now = str(datetime.date.today())
return now
def load_users_from_database():
cursor.execute('SELECT user_id, expiration_time FROM users')
rows = cursor.fetchall()
for row in rows:
user_id = row[0]
expiration_time = datetime.datetime.strptime(row[1], '%Y-%m-%d %H:%M:%S')
if expiration_time > datetime.datetime.now():
allowed_users.append(user_id)
def save_user_to_database(connection, user_id, expiration_time):
cursor = connection.cursor()
cursor.execute('''
INSERT OR REPLACE INTO users (user_id, expiration_time)
VALUES (?, ?)
''', (user_id, expiration_time.strftime('%Y-%m-%d %H:%M:%S')))
connection.commit()
@bot.message_handler(commands=['add'])
def add_user(message):
admin_id = message.from_user.id
if admin_id != ADMIN_ID:
bot.reply_to(message, 'Bạn không có quyền sử dụng lệnh này.')
return
message_parts = message.text.split()
if len(message_parts) == 1:
bot.reply_to(message, 'Vui lòng nhập ID người dùng.')
return
if len(message_parts) < 3:
bot.reply_to(message, 'Vui lòng nhập đủ thông tin.')
return
user_id = message_parts[1]
ngay = int(message_parts[2])
allowed_users.append(user_id)
expiration_time = datetime.datetime.now() + datetime.timedelta(days=int(ngay))
connection = sqlite3.connect('user_data.db')
save_user_to_database(connection, user_id, expiration_time)
connection.close()
bot.reply_to(message, 'Add Success Vip\nId_User : {user_id}\nDay : {ngay}\n')
load_users_from_database()
@bot.message_handler(commands=['vipspam'])
def lqm_sms(message):
user_id = message.from_user.id
if user_id not in allowed_users:
bot.reply_to(message, text='Bạn không có quyền sử dụng lệnh này!')
return
if len(message.text.split()) == 1:
bot.reply_to(message, 'Enter Phone Number')
return
phone_number = message.text.split()[1]
if not phone_number.isnumeric():
bot.reply_to(message, 'Phone Number Not Working')
return
if phone_number in ['113','911','114','115','1800']:
# Số điện thoại nằm trong danh sách cấm
bot.reply_to(message,"LOL ! NO SPAM")
return
bot.reply_to(message, f'''┏━━━━━━━━━━━━━━━━━━━━┓
┣➤ ⊂🚀⊃Attack Success⊂🚀⊃
┣➤Commands : VIP
┣➤Attack By :
┣➤Bot :
┣➤Attack Type : SMS
┣➤Phone Number : {phone_number} 📱
┣➤Attack Delay : 200 Delay
┣➤Admin :
┗━━━━━━━━━━━━━━━━━━━━➤
''')
@bot.message_handler(commands=['spam'])
def sms(message):
if len(message.text.split()) == 1:
bot.reply_to(message, 'Please Enter Phone Number')
return
phone_number = message.text.split()[1]
if not phone_number.isdigit() or len(phone_number) != 10:
bot.reply_to(message, 'Please Enter 10 Digits Phone Number')
return
file_path = os.path.join(os.getcwd(), "smsfree.py")
process = subprocess.Popen(["python", file_path, phone_number, "50"])
processes.append(process)
bot.reply_to(message, f'''┏━━━━━━━━━━━━━━━━━━━━┓
┣➤Bot : @truongdeptrai7
┣➤Attack Type : SMS
┣➤Phone Number : {phone_number} 📱
┣➤Attack Deply : 50 Deply
┣➤Admin : @truongdeptrai7
┗━━━━━━━━━━━━━━━━━━━━➤
''')
@bot.message_handler(func=lambda message: message.chat.id != Group_Id_Chat)
def handle_message(message):
# Gửi thông báo nếu bot nhận được tin nhắn từ một nhóm khác
bot.reply_to(message, "Bot Working in Group[https://t.me/concunha] AD @truongdeptrai7 ")
bot.message_handler(commands=['status'])
def status(message):
user_id = message.from_user.id
if user_id != ADMIN_ID:
bot.reply_to(message, 'User Does Not Have Authority To Use This Command.')
return
if user_id not in allowed_users:
bot.reply_to(message, text='User Does Not Have Authority To Use This Command!')
return
process_count = len(processes)
bot.reply_to(message, 'Number of running processes {process_count}.')
@bot.message_handler(commands=['restart'])
def restart(message):
user_id = message.from_user.id
if user_id != ADMIN_ID:
bot.reply_to(message, 'User Does Not Have Authority To Use This Command.')
return
bot.reply_to(message, 'Please Wait Bot Reset....')
time.sleep(2)
python = sys.executable
os.execl(python, python, *sys.argv)
@bot.message_handler(commands=['stop'])
def stop(message):
user_id = message.from_user.id
if user_id != ADMIN_ID:
bot.reply_to(message, 'User Does Not Have Authority To Use This Command.')
return
bot.reply_to(message, 'Please Wait Bot Stop....')
time.sleep(2)
bot.stop_polling()
@bot.message_handler(commands=['help','start'])
def help(message):
help_text = '''
┏━━━━━━━━━━━━━━┓
┣➤ Commands Spam
┗━━━━━━━━━━━━━━➤
┏━━━━━━━━━━━━━━┓
┣➤ /spam : [ Commands Free] /spam + phone
┣➤ /vipspam : [ Commands Vip ] /vipspam + phone.
┗━━━━━━━━━━━━━━➤
┏━━━━━━━━━━━━━━┓
┣➤ Command Admin
┗━━━━━━━━━━━━━━➤
┣➤/status :
┣➤/restart : Reset Bot
┣➤/stop : Stop Run Bot
┗━━━━━━━━━━━━━━➤
'''
bot.reply_to(message, help_text)
# Khởi tạo bot ứng dụng của bạn
# Lệnh "/start" để bắt đầu theo dõi thời gian
bot.polling()