from telegram import Update
from telegram.ext import ApplicationBuilder, ContextTypes, CommandHandler

# Mettez votre ID ici (trouvable via @userinfobot sur Telegram)
AUTHORIZED_USER_ID =8828372538

async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
    # Sécurité : Vérifier qui appelle le bot
    if update.effective_user.id != AUTHORIZED_USER_ID:
        await context.bot.send_message(chat_id=update.effective_chat.id, text="Accès refusé.")
        return

    await context.bot.send_message(chat_id=update.effective_chat.id, text="Le bot fonctionne sur le Raspberry Pi !")

if __name__ == '__main__':
    application = ApplicationBuilder().token('8826036227:AAE1GeXKFl-P89cIYo4RH3qzwfzSo5C2ATE').build()
    
    start_handler = CommandHandler('start', start)
    application.add_handler(start_handler)
    
    print("Bot en ligne...")
    application.run_polling()

