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
- '''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('JA5tAQ5_tOp03a101D7f6Q'))
- id = test.ID
- try:
- chat = app.join_chat('https://t.me/joinchat/JA5tAQ5_tOp03a101D7f6Q')
- except Exception as e:
- print(str(e))
- user = [line.rstrip('\n') for line in open('base.txt', encoding="utf-8-sig")]
- s = []
- for i in range(5):
- a = user[i]
- u = app.resolve_peer(a)
- s.append(u)
- user.remove(a)
- update = app.send(
- functions.channels.InviteToChannel(
- channel=id, # ID or Username
- users=s
- )
- )
- app.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement