import requests
import json

BOT_TOKEN = "BOT_TOKEN_ADRESIN"


updates_url = f"https://api.telegram.org/bot{BOT_TOKEN}/getUpdates"
response = requests.get(updates_url)
data = response.json()


me_url = f"https://api.telegram.org/bot{BOT_TOKEN}/getMe"
me_response = requests.get(me_url)
me_data = me_response.json()

bot_username = me_data.get("result", {}).get("username", "❓ Bulunamadı")
bot_url = f"https://t.me/{bot_username}" if bot_username != "❓ Bulunamadı" else "❓ URL bilinmiyor"

try:
    if data.get("result"):
        for update in data["result"]:
            message = update.get("message")
            if message:
                chat = message.get("chat")
                if chat and chat.get("type") in ["group", "supergroup"]:
                    chat_id = chat.get("id")
                    title = chat.get("title", "❓ Grup Adı Yok")
                    print("🎯 [Grup Bilgisi]")
                    print(f"🆔 Chat ID   : {chat_id}")
                    print(f"🔑 Bot Token : {BOT_TOKEN}")
                    print(f"🤖 Bot Adı   : @{bot_username}")
                    print(f"🔗 Bot URL   : {bot_url}")
                    print(f"📛 Grup Adı  : {title}")
                    break
        else:
            print("⚠️ Grup mesajı bulunamadı. Lütfen gruptan bir mesaj gönder.")
    else:
        print("⚠️ Hiç mesaj alınamadı. Grupta botu etiketleyip bir mesaj atmayı dene.")

except Exception as e:
    print(f"❌ Hata oluştu: {e}")

input("\n⏳ Çıkmak için ENTER tuşuna bas...")
Python yüklüyse, bu koda bot token adresini yaz, gruba ekle yönetici yap ve ardından test mesajı at grubuna daha sonra bu kodu calıstır. sana şöyle çıktı verecek.



🎯 [Grup Bilgisi]
🆔 Chat ID :
🔑 Bot Token :
🤖 Bot Adı :
🔗 Bot URL :
📛 Grup Adı :