Spaces:
Running
Running
Commit History
-
Update index.html
Verified signaturefrom telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, WebAppInfo from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes BOT_TOKEN = "YOUR_BOT_TOKEN" HF_URL = "https://your-space-name.hf.space" async def start(update: Update, context: ContextTypes.DEFAULT_TYPE): keyboard = [[ InlineKeyboardButton( "Open App 🚀", web_app=WebAppInfo(url=HF_URL) ) ]] reply_markup = InlineKeyboardMarkup(keyboard) await update.message.reply_text("Click below:", reply_markup=reply_markup) async def receive_data(update: Update, context: ContextTypes.DEFAULT_TYPE): data = update.effective_message.web_app_data.data await update.message.reply_text(f"Received: {data}") app = ApplicationBuilder().token(BOT_TOKEN).build() app.add_handler(CommandHandler("start", start)) app.run_polling()dc3ed8c -
initial commit
Verified signature2d3589a