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

# Remplacez 'YOUR_TOKEN_HERE' par le token de votre bot
TOKEN = '7150777483:AAHBJ86IBcb7KDM8vDong3ONCCYyw28a2FI'

async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    await update.message.reply_text('Bonjour! Utilisez /chatid pour obtenir votre identifiant de chat.')

async def chatid(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    chat_id = update.message.chat_id
    await update.message.reply_text(f'Votre identifiant de chat est {chat_id}')

def main() -> None:
    # Créer l'application
    application = Application.builder().token(TOKEN).build()

    # Ajouter les gestionnaires de commande
    application.add_handler(CommandHandler("start", start))
    application.add_handler(CommandHandler("chatid", chatid))

    # Démarrer le bot
    application.run_polling()

if __name__ == '__main__':
    main()
