import logging
from telegram import Update
from telegram.ext import Application, CommandHandler, ContextTypes

# Enable logging
logging.basicConfig(
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    level=logging.DEBUG
)
logger = logging.getLogger(__name__)

# Define a few command handlers
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    logger.info("Start command received")
    await update.message.reply_text('Hello! I am a test bot.')

async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    logger.info("Help command received")
    await update.message.reply_text('Help!')

def main() -> None:
    # Use the token directly
    TOKEN = "7723033292:AAF4HDxoD7Ll_2qsiYCu9GBN6u6GM4tr34U"
    
    # Create the Application
    application = Application.builder().token(TOKEN).build()

    # Add handlers
    application.add_handler(CommandHandler("start", start))
    application.add_handler(CommandHandler("help", help_command))

    # Run the bot until the user presses Ctrl-C
    logger.info("Starting test bot")
    application.run_polling(drop_pending_updates=True)

if __name__ == '__main__':
    main()
