from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
import requests



    
async  def tc(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    print("hello")
    """Add a job to the queue."""
    chat_id = update.effective_message.chat_id
    try:
        # args[0] should contain the time for the timer in seconds
        username = len(context.args[0])
        if username <= 0:
            await update.effective_message.reply_text("Lütfen geçerli bir değer girin.")
            return
        await update.message.reply_text(f'Kullanıcı için TC Kimlik bilgileri sorgulanıyor.. 🔍'+str(context.args[0]))
        url = "https://telegram.enzabonus.com/anasayfa/tcsorgu?username="+str(context.args[0])
        r = requests.get(url)
        

    except (IndexError, ValueError):
        await update.effective_message.reply_text("Kullanım: /tc <kullanıcı adı>")

async  def ip(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    print("hello")
    """Add a job to the queue."""
    chat_id = update.effective_message.chat_id
    try:
        # args[0] should contain the time for the timer in seconds
        username = len(context.args[0])
        if username <= 0:
            await update.effective_message.reply_text("Lütfen geçerli bir değer girin.")
            return
        await update.message.reply_text(f'Kullanıcı için IP gecmisi sorgulanıyor.. 🔍'+str(context.args[0]))
        url = "https://telegram.enzabonus.com/anasayfa/ip?username="+str(context.args[0])
        r = requests.get(url)
        

    except (IndexError, ValueError):
        await update.effective_message.reply_text("Kullanım: /ip <kullanıcı adı>")

app = ApplicationBuilder().token("7176526849:AAFDLEQZb7gtEAJDlTTJm_OfkuxDPeGUNCk").build()


app.add_handler(CommandHandler("tc", tc))

app.add_handler(CommandHandler("ip", ip))

app.run_polling()
