[Nulled] » Nulled Warez Scripts » Telegram » Telegram Chat Spammer
July 30 2024

Telegram Chat Spammer

DevPHP 30-07-2024, 04:11 Telegram»,Telegram Bot 37

A simple spammer on Telegram chats
Written in Python

A simple spammer on Telegram chats



from pyrogram import Client
from pyrogram.errors import FloodWait, BadRequest, Flood, InternalServerError
from time import sleep
from sys import stderr, exit
from loguru import logger
from msvcrt import getch
from os import system
import time
import re

def clear(): return system('cls')

api = open('apis.txt').read().split(' ')

SESSION = input('Enter the phone number: ')
logger.remove()
logger.add(stderr,
           format='<white>{time:HH:mm:ss}</white> | '
                  '<level>{level: <8}</level> | '
                  '<cyan>{line}</cyan> - '
                  '<white>{message}</white>')

app = Client(SESSION, int(api[0]), api[1])

with open('Чаты.txt ', 'r', encoding='utf-8') as file:
    chat_list = [row.strip() for row in file]

message_text = open('Сообщение.txt ', 'r', encoding='utf-8').read()

def https_delete(listname):
    for https in range(len(listname)):
        listname[https] = re.sub('https://t.me/', '', listname[https])

def send_message(current_chat):
    for _ in range(3):
        try:
            with app:
                app.send_message(current_chat, message_text)

        except FloodWait as error:
            logger.info(f'{current_chat} | FloodWait: {error.x}')
            sleep(error.x)

        except Flood:
            pass

        except BadRequest as error:
            logger.error(f'{current_chat} | {error}')

        except InternalServerError as error:
            logger.error(f'{current_chat} | {error}')

        except Exception as error:
            logger.error(f'{current_chat} | {error}')

        else:
            logger.success(f'{current_chat} | The message was successfully sent')
            return

    with open('errors_send_message.txt', 'a', encoding='utf-8') as file:
        file.write(f'{current_chat}\n')


def join_chat(current_chat):
    for _ in range(3):
        try:
            with app:
                app.join_chat(current_chat)

        except FloodWait as error:
            logger.info(f'{current_chat} | FloodWait: {error.x}')
            sleep(error.x)

        except Flood:
            pass

        except BadRequest as error:
            logger.error(f'{current_chat} | {error}')

        except InternalServerError as error:
            logger.error(f'{current_chat} | {error}')

        except Exception as error:
            logger.error(f'{current_chat} | {error}')

        else:
            logger.success(f'{current_chat} | Successfully logged into the chat')
            return

    with open('errors_join_chat.txt', 'a', encoding='utf-8') as file:
        file.write(f'{current_chat}\n')

if __name__ == '__main__':
    https_delete(chat_list)
print('Joining chats...')
for current_chat in chat_list:
join_chat(current_chat)

    number_of_sends = int(input('How many times do you want to send a message to chats?: '))
    sleep_time = int(input('Enter the delay between messages in seconds: '))
for current_chat in chat_list:
for sending_messages in range(number_of_sends):
            send_message(current_chat)
time.sleep(sleep_time)

print('Work completed successfully!')
print('\n To exit, press any key.')
getch()
exit()


Installation:
1. Open the console and go to the folder with the script, write pip install -r requirements.txt
2. We are waiting for the installation of all necessary libraries

Instruction manual:
1. Write your message to a file Сообщение.txt
2. Insert links to the chats where you want to send this message
3. Enter the number of times to send, and the delay

Update: Fixed working code:

1. Create a send.py is in the archive and we throw the code below there:

from pyrogram import Client
from pyrogram.errors import FloodWait, BadRequest, Flood, InternalServerError
from time import sleep
from sys import stderr, exit
from loguru import logger
from dotenv import dotenv_values
from msvcrt import getch
from os import system
import time

def clear(): return system('cls')

config = dotenv_values()
SESSION_NAME = config['session_name']
API_ID = int(config['api_id'])
API_HASH = config['api_hash']
x = 1
logger.remove()
logger.add(stderr,
           format='<white>{time:HH:mm:ss}</white> | '
                  '<level>{level: <8}</level> | '
                  '<cyan>{line}</cyan> - '
                  '<white>{message}</white>')

app = Client(SESSION_NAME, API_ID, API_HASH)

with open('otc.txt', 'r', encoding='utf-8') as file:
    otc_list = [row.strip() for row in file]

msg_text = open('msg_text.txt', 'r', encoding='utf-8').read()

successful_messages = {}

def send_message_otc(current_otc):
    global successful_messages
    for _ in range(3):
        try:
            app.send_message(current_otc, msg_text)

        except FloodWait as error:
            sleep(1)

        except Flood:
            pass

        except BadRequest as error:
            logger.error(f'{current_otc} | {error}')

        except InternalServerError as error:
            logger.error(f'{current_otc} | {error}')

        except Exception as error:
            logger.error(f'{current_otc} | {error}')

        else:
            if current_otc in successful_messages:
                successful_messages[current_otc] += 1
            else:
                successful_messages[current_otc] = 1

            logger.success(f'{current_otc} | The message was successfully sent')
            return

    with open('errors_send_message.txt', 'a', encoding='utf-8') as file:
        file.write(f'{current_otc}\n')

def join_chat_otc(current_otc):
    for _ in range(3):
        try:
            app.join_chat(current_otc)

        except FloodWait as error:
            sleep(1)

        except Flood:
            pass

        except BadRequest as error:
            logger.error(f'{current_otc} | {error}')

        except InternalServerError as error:
            logger.error(f'{current_otc} | {error}')

        except Exception as error:
            logger.error(f'{current_otc} | {error}')

        else:
            logger.success(f'{current_otc} | Successfully logged into the chat')
            return

    with open('errors_join_chat.txt', 'a', encoding='utf-8') as file:
        file.write(f'{current_otc}\n')

def write_successful_messages():
    with open('successful_messages.txt', 'w', encoding='utf-8') as file:
        for chat, count in successful_messages.items():
            file.write(f'{chat}: {count}\n')

if __name__ == '__main__':
    user_action = int(input('Enter your action '
                            '(1 - join chats from .txt; '
                            '2 - send message in chats from .txt): '))

    interval = int(input('Enter the interval between repeated executions (in seconds): '))

    clear()

    while True:
        with app:
            for current_otc in otc_list:
                if user_action == 1:
                    join_chat_otc(current_otc)

                elif user_action == 2:
                    send_message_otc(current_otc)

        logger.success('The work has been completed successfully!')
logger.success(f' Number of successfully sent messages: {sum(successful_messages.values())}')

        write_successful_messages()

        print(f'\nWaiting for {interval} seconds before the next execution...')
        time.sleep(interval)
        clear()




Information

Visitors who are in the group Guests they can't download files.
Log in to the site under your login and password or if you are a new user go through the process registrations on the website.

Comments:

This publication has no comments yet. You can be the first!

Information the publication:

  • Author of the publication: DevPHP
  • Date of publication: 30 July 2024 04:11
  • Publication category(s): Telegram»,Telegram Bot
  • Number of views of the publication: 37
  • Number of comments to the publication: 0

Related News

15 November 2023
Telegram»,Telegram Bot
The script of the

The bot has 3 ready-made payment systems (CRYSTAL PAY (crypta), CRYPTOBOT (P2P crypta), PAYOK (cards, e-wallets,

Read more
30 July 2024
Telegram»,Telegram Bot
The script is a public

The script is a public parser,spammer,inviter for telegrams 💻 YAP: Python 3.8+🐍 💾 Modules: telethon 📂 Database: -

Read more
15 November 2023
Telegram»,Telegram Bot
Telegram Bot Anonymous

Telegram Bot Anonymous Chat

Read more
30 July 2024
Telegram»,Telegram Bot
Script Parsing of

Script Parsing of intimate Telegram photos The software parses intimate photos and moreover relevant by date

Read more
30 July 2024
Telegram»,Telegram Bot
Telegram Freelance

Telegram Freelance Services Bot Script

Read more

Information

Users of 🆅🅸🆂🅸🆃🅾🆁 are not allowed to comment this publication.

Site Search

Site Menu


☑ Websites Scripts

Calendar

«    November 2024    »
MonTueWedThuFriSatSun
 123
45678910
11121314151617
18192021222324
252627282930 

Advertisement

Survey on the website

Evaluate the work of the site
 

Statistics

  • +14 Total articles 6747
  • +16 Comments 4077
  • +28 Users : 5854