from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
import requests
from telebot import TeleBot

async  def saatlik_deposit(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    await update.message.reply_text(f'Raporunuzu hazırlıyorum, lütfen bekleyin {update.effective_user.first_name} Bey')
    url = "https://asibet.app/telegram/saatlik_deposit"
    r = requests.get(url)


async  def gunsonu(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    await update.message.reply_text(f'Raporunuzu hazırlıyorum, lütfen bekleyin {update.effective_user.first_name} Bey')
    url = "https://asibet.app/telegram/gunluksorgu"
    r = requests.get(url)

async  def sorgu(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
        btag = int(context.args[0])
        saat = int(context.args[1])
        if btag <= 0:
            await update.effective_message.reply_text("Lütfen geçerli bir değer girin.")
            return
        await update.message.reply_text(f'Raporunuzu hazırlıyorum, lütfen bekleyin {update.effective_user.first_name} Bey')
        url = "https://asibet.app/telegram/btag?saat="+str(saat)+"&btag="+str(btag)
        r = requests.get(url)
        

    except (IndexError, ValueError):
        await update.effective_message.reply_text("Kullanım: /sorgu <btag> <saat>")
        

app = ApplicationBuilder().token("6290181621:AAHgHe0YGcD4g4LWGrmt_RFVJYBhMgUcVg8").build()

app.add_handler(CommandHandler("rapor", saatlik_deposit))

app.add_handler(CommandHandler("gunsonu", gunsonu))

app.add_handler(CommandHandler("sorgu", sorgu))

app.run_polling()
