Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def chatt(cat,jb,nomor):
- neo= open("list_group.txt","r")
- grp=neo.read().splitlines()
- i=0
- ar = os.listdir('session/')
- for phone in ar:
- if phone.endswith(".session-journal"):
- os.remove('session/'+phone)
- else:
- try:
- nomor = phone.replace('.session','')
- client = get_client(nomor)
- loadCount = 0
- while True:
- group=grp[i]
- my_channel = client.get_entity(group)
- try:
- client(JoinChannelRequest(my_channel))
- print(f"\r\x1b[1;30m[{biru}-\x1b[1;30m]{biru} Join Group : {putih}{group}")
- i+=1
- loadCount+=1
- sleep(3)
- client.send_message(entity=my_channel, message=cat)
- print(f'\r\x1b[1;30m[{biru}-\x1b[1;30m]{biru} chat in group : {kuning}done👍')
- if (loadCount==jb):
- print(f'\r{abu2}[{merah}x{abu2}] {putih}Task Done....!!!!')
- loadCount=0
- try:
- client.disconnect()
- except:
- pass
- break
- except ConnectionError:
- i+=1
- loadCount+=1
- print('next akun')
- except UserBannedInChannelError:
- i+=1
- loadCount+=1
- print(f"\r{kur3}{putih} user baned from {group}")
- except ChatRestrictedError:
- i+=1
- loadCount+=1
- print(f'\r{abu2}[{merah}x{abu2}] {putih} Gagal Mengirim pesan (restrict/harus verifikasi join grup)')
- except ChatWriteForbiddenError:
- i+=1
- loadCount+=1
- print(f'\r{abu2}[{merah}x{abu2}] {putih} Gagal Mengirim pesan (restrict/harus verifikasi join grup)')
- except ChannelPrivateError:
- i+=1
- loadCount+=1
- print(f'\r{abu2}[{merah}x{abu2}] {putih} grup Privat')
- except ChannelInvalidError:
- i+=1
- loadCount+=1
- print(f'\r{abu2}[{merah}x{abu2}] {putih} grup tidak ditemukan')
- except UsernameOccupiedError:
- i+=1
- loadCount+=1
- print(f"\{kur3}{putih} username {group} invalid")
- print(f'\r{hijau}=========================================================')
- try:
- client.disconnect()
- except:
- pass
- except IndexError:
- print(f"{hijau}============================================================")
- return main()
- except TypeError:
- try:
- client.disconnect()
- except Exception :
- pass
- return main()
- print(f"{hijau}============================================================")
- except ChannelsTooMuchError:
- print(f"\r{kur3}{putih} Terlalu banyak grup yg di join.. silahkan leave beberapa grup dahulu")
- except FloodWaitError as e:
- sys.stdout.write(f"\r{abu2}[{kuning}!{abu2}] {kuning}your account must sleep {putih}{e.seconds} seconds")
- try:
- sleep(2)
- print(f'\r{pakuning} {kuning}Tunggu {putih}{e.seconds} {hijau} Detik ')
- print(f"{abu2}[{kuning}!{abu2}] {kuning}Sebelum menjalankan Akun ini kembali dengan script.. !!")
- print(f"{hijau}============================================================")
- finally:
- e = None
- del e
- except PhoneNumberBannedError:
- print(f"\r{kur3}{merah} WARN: {nomor} Account has been banned.")
- tunggu(3)
- os.remove('session/'+nomor+'.session')
- #except Exception as g:
- #print(f'{abu2}[{merah}x{abu2}] {merah}Skip ..!!! {g} ')
- #client.disconnect()
- finally:
- try:
- client.disconnect()
- except Exception :
- pass
- else:
- return main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement