Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pyrogram import Client
- from pyrogram.api import functions, types
- import logging
- import time
- import random
- '''logging.basicConfig(
- level=logging.DEBUG,
- format='[%(threadName)s/%(levelname)s, %(asctime)s] %(name)s:%(lineno)d: %(message)s'
- )'''
- def phone_code_callback(phone_number):
- code = input('code :') # Get your code programmatically
- return code # e.g., "12345"
- app = Client(
- session_name="85267208984",
- #phone_number="85267208984",
- #phone_code=phone_code_callback, # Note the missing parentheses
- #first_name="Pyrogram",
- #last_name="",
- api_id="17349",
- api_hash="344583e45741c457fe1862106095a5eb",
- proxy=dict(
- hostname="5.188.143.176",
- port=3001,
- username="DGnRDP",
- password="PbePbBEP0mI"
- )
- )
- app.start()
- print(app.get_me())
- test = app.send(functions.messages.CheckChatInvite('JA5tAUn3oys5ZJkSJ2Befw'))
- print(test)
- id = test.chat.id
- try:
- chat = app.join_chat('https://t.me/joinchat/JA5tAUn3oys5ZJkSJ2Befw')
- except Exception as e:
- print(str(e))
- user = [line.rstrip('\n') for line in open('base.txt', encoding="utf-8-sig")]
- while True:
- s = []
- for i in range(50):
- print('work '+str(i))
- time.sleep(random.randint(1,3))
- try:
- a = user[i]
- u = app.resolve_peer(a)
- app.send(functions.messages.AddChatUser(id,u,100))
- s.append(u)
- user.remove(a)
- except Exception as e:
- user.remove(a)
- print(str(e))
- time.sleep(random.randint(3,5))
- print(update)
- app.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement