—
—
Ye page asal Telegram Mini App hai. Jaise hi ye kisi bot ke menu button ya inline button se Telegram ke andar khulegi, Telegram khud member ka naam, username aur ID de dega — koi alag sign-up nahi. Neeche pehle apna live status dekhen, phir BotFather ke 5 steps karen.
Ye saaray steps aap ke apne Telegram account se honge. Bot ka token kabhi chat, comment ya kisi page par mat likhen — token sirf BotFather aur aap ke paas rehta hai, is page ko token ki zaroorat hi nahi.
Telegram men @BotFather kholen, /newbot bhejen. Naam likhen: AI With Ayaz Community. Username aisa rakhen jo Bot par khatam ho, maslan AiWithAyazCommunityBot — agar ye taken ho to BotFather khud bata dega, number ya underscore badal kar dobara try karen.
BotFather aik lamba token dega (shakal 123456789:AAE… jaisi hoti hai). Usay apni mehfooz jagah save karen. Token yahan is page par, ya mujhe chat men, bhejne ki zaroorat nahi — Mini App token ke baghair chalti hai; token sirf us waqt chahiye jab bot khud messages bhejna shuru kare.
BotFather men ye commands chala kar bot ka description aur about text laga den — dono copy-ready hain:
Profile photo ke liye /setuserpic chala kar channel ki wahi photo laga den jo aap bot par lagana chahti hain.
BotFather men /mybots → apna bot chunein → Bot Settings → Menu Button → Configure Menu Button. Button text likhen Community Kholein aur URL men is page ka wahi link paste karen jo Muse aap ko is artifact ke sath deta hai. Bas — ab har member bot khol kar menu button dabate hi is app men aa jayega.
Apne bot ko kholen, menu button dabayen. App Telegram ke andar khulegi aur upar wala status “Telegram se Live Connected” ho jayega, sath aap ka naam aur ID auto nazar aayega — bilkul neeche wale app preview ki tarah. Agar status browser wala dikhe, matlab app Telegram ke bahir khuli hai.
Ye chhota Python bot aap ke bot ko zinda karta hai: koi bhi /start likhe to bot welcome message ke sath is community app ka button bhej deta hai. Token sirf apni machine/server par lagana hai, yahan nahi. APP_URL ki jagah is page ka link dalen.
import os
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, WebAppInfo
from telegram.ext import Application, CommandHandler, ContextTypes
TOKEN = os.environ["BOT_TOKEN"] # token code men kabhi mat likhen
APP_URL = "YAHAN_IS_PAGE_KA_LINK" # Muse artifact ka link yahan dalen
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
user = update.effective_user
kb = [[InlineKeyboardButton(
"Community Kholein",
web_app=WebAppInfo(url=APP_URL))]]
await update.message.reply_text(
f"Assalam o Alaikum {user.first_name}! "
"AI With Ayaz Community men khush aamdeed. "
"Neeche wale button se app kholen:",
reply_markup=InlineKeyboardMarkup(kb))
def main():
app = Application.builder().token(TOKEN).build()
app.add_handler(CommandHandler("start", start))
app.run_polling()
if __name__ == "__main__":
main()
/start par jawab ya announcements bhejna ho.Jo ho jaye, usay mark kar den — ye sirf is visit ke liye hai, page band karne par reset ho jayega.