0% found this document useful (0 votes)
41 views4 pages

Telethon Spam Bot Configuration

The document is a Python script designed for spamming messages on Telegram using the Telethon library. It includes functionalities for handling sessions, sending messages to contacts, and managing proxies, while also implementing error handling for various exceptions. The script requires a configuration file and utilizes threading for concurrent message sending, along with randomization features for message content and timing.

Uploaded by

mygiw.2007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views4 pages

Telethon Spam Bot Configuration

The document is a Python script designed for spamming messages on Telegram using the Telethon library. It includes functionalities for handling sessions, sending messages to contacts, and managing proxies, while also implementing error handling for various exceptions. The script requires a configuration file and utilizes threading for concurrent message sending, along with randomization features for message content and timing.

Uploaded by

mygiw.2007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

from importlib.

machinery import SourceFileLoader


global allcounter # inserted
import [Link]
from [Link] import TelegramClient, events
from [Link] import CreateChannelRequest,
CheckUsernameRequest, UpdateUsernameRequest
from [Link] import GetHistoryRequest
from [Link] import InputChannel, InputPeerChannel
from telethon import functions, types, errors
from time import sleep
import types as types2
import subprocess
import requests
import time
import os
import socks
from threading import Thread
import asyncio
import spintax
import colorama
import random
import sys
import json
try:
config = SourceFileLoader('cfg', '[Link]')
cfg = [Link]([Link])
config.exec_module(cfg)
colors = list(vars([Link]).values())
allcounter = 0

def spamer(sesname, message):


global allcounter # inserted
method = [Link]
color = [Link](colors)
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

@[Link]
case 0:
app_version = [Link]

@[Link]
case 0:
device_model = cfg.device_model
if [Link]:
proxyRand = [Link]([Link]).split(':')
proxy = (socks.SOCKS5, proxyRand[0], int(proxyRand[1]), True,
proxyRand[2], proxyRand[3])
try:
client = TelegramClient(f'./sessions/{sesname}', api_id=cfg.api_id,
api_hash=cfg.api_hash, app_version=app_version, device_model=device_model,
lang_code=cfg.lang_code, system_lang_code=cfg.system_lang_code, proxy=proxy)
[Link]()
break
try:
match method:
pass # postinserted
case 1:
client.send_message([Link], message)
for m in client.iter_messages([Link], 1):
msg = m
print(f'- Запуск сессии: {sesname}. Устройство: {device_model}.
Версия приложения: {app_version}. Прокси: {proxyRand[0]}')
if [Link]!= 0:
print(f'Задержка {[Link]} секунд перед
запуском.')
sleep([Link])
try:
dialogs = client.get_dialogs()
contacts = client([Link](hash=(-
12398745604826)))
counter = 0
for d in dialogs:
try:
match method:
pass # postinserted
case 0:
res = client.send_message(d, message)
if [Link]:
client.delete_messages(d, res, revoke=False)
counter += 1
allcounter += 1
print(color, f'- Сессия {sesname} Отправляем сообщение,
Отправлено сообщений: {counter}')
sleep([Link]([Link], [Link]))
for c in [Link]:
try:
match method:
pass # postinserted
case 0:
res = client.send_message(c, message)
if [Link]:
client.delete_messages(c, res, revoke=False)
counter += 1
allcounter += 1
print(color, f'- Сессия {sesname} Отправляем
сообщение контакту, Отправлено сообщений: {counter}')
sleep([Link]([Link], [Link]))
break
[Link]()
except Exception as e:
return print(f'- Произошла ошибка при подключении сессии {e}')
except Exception as e:
return print(f'- Произошла ошибка при запуске сессии: {e}')
except Exception as e:
return print(f'-Произошла ошибка при парсинге чатов и контактов: {e}')
except [Link]:
print(f'-Сессия {sesname} умерла.')
break
except [Link]:
continue
except [Link]:
continue
except [Link]:
continue
except [Link] as e:
print(f'- Сессия {sesname} Флудвейт {[Link]}')
break
except Exception as e:
print(f'- Сессия {sesname} Ошибка: {e}')
continue
except [Link]:
print(f'-Сессия {sesname} умерла.')
break
except [Link]:
continue
except [Link]:
continue
except [Link]:
continue
except [Link] as e:
print(f'- Сессия {sesname} Флудвейт {[Link]}')
break
except Exception as e:
print(f'- Сессия {sesname} Ошибка: {e}')
continue

def sessions():
if [Link]:
t = 'включено'
print(f'Удаление сообщений {t}!')
threads = []
message = [Link]([Link])
session = None
th = Thread(target=spamer, args=(session, message))
[Link](th)
[Link]()
sleep([Link])
for thread in threads:
[Link]()
input(f'Спам завершён.\nОтправлено сообщений: {allcounter}')
try:
hwid = subprocess.check_output('wmic csproduct get uuid').decode().split('\
n')[1].strip()
r = [Link]('[Link]
if hwid in [Link]:
pass
print('⢳⣿⣿⡏⢚⠿⠓⡨⠒⠒⠒⠲⡄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄', 'TELEGRAM SPAMER 2.0')
print('⣾⣿⣿⢣⢿⡕⠫⠊⢀⢌⠹⡐⡟⢣⠄⠄⠄⢀⣠⣤⣤⣤⣤⣤⣀⠄⠄⠄', 'Channel: @orehsoft')
print('⣸⣿⣿⣿⣠⠏⡔⠁⠄⠐⠢⠣⢡⣙⠄⡇⣶⣿⣿⣿⣿⢟⣻⣿⣿⠏⠄⠄', 'Dev: @iihush @e1111r')
print('⣿⣿⣿⡇⢩⠘⣴⣿⣥⣤⢦⢁⠄⠉⡄⡇⠛⠛⠛⢛⣭⣾⣿⣿⡏⠄⠄⠄')
print('⣿⣿⣿⡇⠹⢇⡹⣿⣿⣛⣓⣿⡿⠞⠑⣱⠄⢀⣴⣿⣿⣿⣿⡟⠄⠄⠄⠄')
print('⣿⣿⣿⣧⣸⡄⣿⣪⡻⣿⠿⠋⠄⠄⣀⣀⢡⣿⣿⣿⣿⡿⠋⠄⠄⠄⠄⠄')
print('⠘⣿⣿⣿⣿⣷⣭⣓⡽⡆⡄⢀⣤⣾⣿⣿⣿⣿⣿⡿⠋⠄⠄⠄⠄⠄⠄⠄')
print('⠄⢨⡻⡇⣿⢿⣿⣿⣭⡶⣿⣿⣿⣜⢿⡇⡿⠟⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄')
print('⠄⠸⣷⡅⣫⣾⣿⣿⣿⣷⣙⢿⣿⣿⣷⣦⣚⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄')
print('⠄⠄⢉⣾⡟⠙⠶⠖⠈⢻⣿⣷⣅⢻⣿⣿⣿⣿⣿⣶⣶⡆⠄⣤⡀⠄⠄⠄')
print('⠄⢠⣿⣿⣧⣀⣀⣀⣀⣼⣿⣿⣿⡎⢿⣿⣿⣿⣿⣿⣿⣇⠄⠈⠁⠄⠄⠄')
print('⠄⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢇⣎⢿⣿⣿⣿⣿⣿⣿⣿⣶⣶⠄⠄⠄')
print('⠄⠄⠻⢿⣿⣿⣿⣿⣿⣿⣿⢟⣫⣾⣿⣷⡹⣿⣿⣿⣿⣿⣿⣿⡟⠄⠄⠄')
print('⠄⠄⠄⠄⢮⣭⣍⡭⣭⡵⣾⣿⣿⣿⡎⣿⣿⣌⠻⠿⠿⠿⠟⠋⠄⠄⠄⠄')
print('⠄⠄⠄⠄⠈⠻⣿⣿⣿⣿⣹⣿⣿⣿⡇⣿⣿⡿⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄')
print('⠄⠄⣀⣴⣾⣶⡞⣿⣿⣿⣿⣿⣿⣿⣾⣿⡿⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄')
print('⣠⣾⣿⣿⣿⣿⣿⣹⣿⣿⣿⣿⣿⡟⣹⣿⣳⡄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄', end='\n\n\n')
sessions()
except Exception as e:
input('Файл [Link] не найден в папке с софтом. Перезапустите программу!')
except Exception as e:
print(e)
input('Произошла ошибка при проверке привязки. Возможно проблемы с сервером или
ведутся технические работы, напиши @iihush')

You might also like