Untitled
unknown
plain_text
3 years ago
3.1 kB
13
Indexable
import telebot
from pyrogram import Client
import time
from pyrogram.enums import ChatMembersFilter
token = ""
api_id = ""
api_hash = ''
telefon = '+'
grup_ismi = -1001317990474
kelime_listesi = ['trade','forex'] #hepsi küçük harf olmalı
print('Session Bağlantısı Bekleniyor.')
bot = telebot.TeleBot(token)
app = Client(telefon, api_id, api_hash)
app.connect()
bot_id = (bot.get_me()).id
status_option = input('Son Görülmesi Uzun Zaman Önce Olanlar Dahil Edilsin Mi? (e/h):')
options = ['',"q","w","e","r","t","y","u","ı","o","p","ğ","ü","a","s","d","f","g","h","j","k","l","ş","i","z","x","c","v","b","n","m","ö","ç","1","2","3","4","5","6","7","8","9",".",","]
listedekiler = []
for dd in options :
for n,i in enumerate(app.get_chat_members(grup_ismi,query=dd)) :
print('Taranan Üye Sırası:',n)
try:
trade = False
for kelime in kelime_listesi :
if str(i.user.last_name).lower().find() != -1 :
trade = True
except :
trade = False
try :
username1 = False
for kelime in kelime_listesi :
if str(i.user.username).lower().find() != -1 :
username1 = True
except :
username1 = False
try:
first_name1 = False
for kelime in kelime_listesi :
if str(i.user.first_name).lower().find() != -1 :
first_name1 = True
except :
first_name1 = False
kosul = (i.user.is_bot) or (i.user.is_deleted) or (i.user.is_scam) or (i.user.is_fake) or first_name1 or username1 or trade
if status_option == 'e':
kosul = kosul or str(i.user.status) == 'UserStatus.LONG_AGO'
if kosul :
chat_id = str(i.user.id)
try:
username = str(i.user.username)
except :
username = ''
first_name = i.user.first_name
if chat_id != str(bot_id) and chat_id not in listedekiler :
listedekiler.append(chat_id)
file=open('banlist.txt','a',encoding='utf-8')
file.write(f'Kullanıcı Adı:{username} İsim:{first_name} Chat ID:{chat_id}\n')
file.close()
if n %200 == 0 :
time.sleep(2)
bot_secenek = input('Banlist.txt Dosyasındaki Kişilerin Gruptan Atılması için Enter basınız:')
file = open('banlist.txt','r',encoding='utf-8')
bilgiler = file.readlines()
file.close()
for i in bilgiler :
if i != '' :
chat_id = i.split('Chat ID:')[1].replace('\n','')
a =bot.kick_chat_member(grup_ismi,int(chat_id))
file = open('banlist.txt','w')
file.close()
print('Üyeler Gruptan Atıldı. Mesajlar Silinecek.')
for i in (app.get_chat_history(grup_ismi)) :
try:
if str(i.from_user.id) == str(bot_id) :
message_id = i.id
bot.delete_message(grup_ismi,message_id)
except :
pass
Editor is loading...