Telegram gruptan gruba üye çekme scripti

Python ile kullanabileceğiniz basit proxy ile çalışan gruptan gruba üye çekme scripti.



import time

from telethon import TelegramClient

from telethon.tl.functions.channels import InviteToChannelRequest

from telethon.errors import FloodWaitError, UserPrivacyRestrictedError, ChatWriteForbiddenError, SessionRevokedError


# Telegram API bilgileri

api_id = 'BURAYA YAZ'

api_hash = 'BURAYA YAZ'

phone_number = 'BURAYA NUMARA YAZ'


 Proxy listesi

proxies = [

    {'proxy_type': 'http', 'addr': '', 'port': 80},     

    {'proxy_type': 'http', 'addr': '', 'port': 80},      

    {'proxy_type': 'http', 'addr': '', 'port': 3128},   

]


# Kaynak grup ve hedef grup

target_group = ''  # Üyelerin davet edileceği grup (grup bağlantısı veya ID'si)

source_group = ''  # Üyelerin alınacağı kaynak grup (SPYHACKERZ DAN ÜYE ÇEKMEYİN DİREK BANLANIRSINIZ :D)


wait_time = 30  


current_proxy_index = 0

client = None


async def switch_proxy():

    """Bir sonraki proxy'ye geç."""

    global current_proxy_index, client

    if client:

        await client.disconnect()  

    

    proxy = proxies[current_proxy_index]

    current_proxy_index = (current_proxy_index + 1) % len(proxies)

    print(f"Yeni proxy'ye geçiliyor: {proxy['addr']}:{proxy['port']}")


    # Yeni proxy ile TelegramClient oluşturuluyor

    client = TelegramClient(

        'session',

        api_id,

        api_hash,

        proxy=(proxy['proxy_type'], proxy['addr'], proxy['port'])

    )

    

    await client.connect() 

    print("Bağlantı sağlandı.")


    

    if not await client.is_user_authorized():

        await client.send_code_request(phone_number)

        await client.sign_in(phone_number, input("Giriş kodu: "))


async def invite_members(members):

    """Hedef gruba üyeleri davet et."""

    count = 0

    for user in members:

        try:

            await client(InviteToChannelRequest(target_group, [user]))

            count += 1

            print(f"{user.username or user.id} davet edildi. Toplam davet edilen: {count}")

            time.sleep(wait_time)

        

        except FloodWaitError as e:

            print(f"Flood limitine ulaşıldı, {e.seconds} saniye bekleniyor...")

            time.sleep(e.seconds)

            await switch_proxy()  # Proxy değiştiriyoruz.


        except UserPrivacyRestrictedError:

            print(f"{user.username or user.id} gizlilik nedeniyle davet edilemedi.")

            continue


        except ChatWriteForbiddenError:

            print("Mesaj gönderme engeli alındı. Proxy değiştiriliyor...")

            await switch_proxy()

        

        except SessionRevokedError:

            print("Hesap engellendi. Proxy değiştiriliyor...")

            await switch_proxy()


        except Exception as e:

            print(f"Bir hata oluştu: {e}")

            continue


async def main():

    await switch_proxy()  


    print("Kaynak gruptan üyeler yükleniyor...")

    members = await client.get_participants(source_group)  

    print(f"{len(members)} üye bulundu.")


    await invite_members(members)


if __name__ == "__main__":

    

    client = TelegramClient('session', api_id, api_hash)

    client.start()

    client.loop.run_until_complete(main())


Daha yeni Daha eski