Advertisement
Xuzut

join

Dec 20th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.50 KB | None | 0 0
  1. def chatt(cat,jb,nomor):
  2. neo= open("list_group.txt","r")
  3. grp=neo.read().splitlines()
  4. i=0
  5. ar = os.listdir('session/')
  6. for phone in ar:
  7. if phone.endswith(".session-journal"):
  8. os.remove('session/'+phone)
  9. else:
  10. try:
  11. nomor = phone.replace('.session','')
  12. client = get_client(nomor)
  13. loadCount = 0
  14. while True:
  15. group=grp[i]
  16. my_channel = client.get_entity(group)
  17. try:
  18. client(JoinChannelRequest(my_channel))
  19. print(f"\r\x1b[1;30m[{biru}-\x1b[1;30m]{biru} Join Group : {putih}{group}")
  20. i+=1
  21. loadCount+=1
  22. sleep(3)
  23. client.send_message(entity=my_channel, message=cat)
  24. print(f'\r\x1b[1;30m[{biru}-\x1b[1;30m]{biru} chat in group : {kuning}done👍')
  25. if (loadCount==jb):
  26. print(f'\r{abu2}[{merah}x{abu2}] {putih}Task Done....!!!!')
  27. loadCount=0
  28. try:
  29. client.disconnect()
  30. except:
  31. pass
  32. break
  33. except ConnectionError:
  34. i+=1
  35. loadCount+=1
  36. print('next akun')
  37. except UserBannedInChannelError:
  38. i+=1
  39. loadCount+=1
  40. print(f"\r{kur3}{putih} user baned from {group}")
  41. except ChatRestrictedError:
  42. i+=1
  43. loadCount+=1
  44. print(f'\r{abu2}[{merah}x{abu2}] {putih} Gagal Mengirim pesan (restrict/harus verifikasi join grup)')
  45. except ChatWriteForbiddenError:
  46. i+=1
  47. loadCount+=1
  48. print(f'\r{abu2}[{merah}x{abu2}] {putih} Gagal Mengirim pesan (restrict/harus verifikasi join grup)')
  49. except ChannelPrivateError:
  50. i+=1
  51. loadCount+=1
  52. print(f'\r{abu2}[{merah}x{abu2}] {putih} grup Privat')
  53. except ChannelInvalidError:
  54. i+=1
  55. loadCount+=1
  56. print(f'\r{abu2}[{merah}x{abu2}] {putih} grup tidak ditemukan')
  57. except UsernameOccupiedError:
  58. i+=1
  59. loadCount+=1
  60. print(f"\{kur3}{putih} username {group} invalid")
  61. print(f'\r{hijau}=========================================================')
  62. try:
  63. client.disconnect()
  64. except:
  65. pass
  66. except IndexError:
  67. print(f"{hijau}============================================================")
  68. return main()
  69. except TypeError:
  70. try:
  71. client.disconnect()
  72. except Exception :
  73. pass
  74. return main()
  75. print(f"{hijau}============================================================")
  76. except ChannelsTooMuchError:
  77. print(f"\r{kur3}{putih} Terlalu banyak grup yg di join.. silahkan leave beberapa grup dahulu")
  78. except FloodWaitError as e:
  79. sys.stdout.write(f"\r{abu2}[{kuning}!{abu2}] {kuning}your account must sleep {putih}{e.seconds} seconds")
  80. try:
  81. sleep(2)
  82. print(f'\r{pakuning} {kuning}Tunggu {putih}{e.seconds} {hijau} Detik ')
  83. print(f"{abu2}[{kuning}!{abu2}] {kuning}Sebelum menjalankan Akun ini kembali dengan script.. !!")
  84. print(f"{hijau}============================================================")
  85. finally:
  86. e = None
  87. del e
  88. except PhoneNumberBannedError:
  89. print(f"\r{kur3}{merah} WARN: {nomor} Account has been banned.")
  90. tunggu(3)
  91. os.remove('session/'+nomor+'.session')
  92. #except Exception as g:
  93. #print(f'{abu2}[{merah}x{abu2}] {merah}Skip ..!!! {g} ')
  94. #client.disconnect()
  95. finally:
  96. try:
  97. client.disconnect()
  98. except Exception :
  99. pass
  100. else:
  101. return main()
  102.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement