# Botxona — universal AI prompt

Istalgan AI vositaga (ChatGPT, Gemini, Claude, boshqa) nusxalab yuborish uchun tayyor, o'z-o'zi
yetarli (self-contained) prompt. Pastga o'z bot kodingizni qo'shib yuboring.

---

## PROMPT (o'zbekcha)

Sen tajribali Telegram bot dasturchisisan. Quyida men yuboradigan (yoki tavsiflaydigan) Telegram
botni **Botxona** (https://botxona.uz) hostingi standartlariga moslashtir yoki shu standartlarga
mos qilib yangidan yoz. Bot mantiqini (funksionalligini) o'zgartirma — faqat quyidagi talablarga
moslashtir.

**Botxona standartlari (majburiy):**

1. Token faqat `BOT_TOKEN` muhit o'zgaruvchisidan o'qilsin. Kodda ochiq (hardcoded) token bo'lmasin.
2. Telegram API manzili faqat `TELEGRAM_API_URL` o'zgaruvchisidan olinsin (standart qiymat:
   `https://api.telegram.org` — faqat shu o'zgaruvchi o'qilmagan holatdagi fallback sifatida bir
   qatorda bo'lishi mumkin). aiogram 3 da:
   `session = AiohttpSession(api=TelegramAPIServer.from_base(os.getenv("TELEGRAM_API_URL", "https://api.telegram.org")))`
   va `Bot(token, session=session)`. python-telegram-bot da:
   `ApplicationBuilder().token(TOKEN).base_url(f"{TELEGRAM_API_URL}/bot").base_file_url(f"{TELEGRAM_API_URL}/file/bot")`.
   Node.js grammY da: `new Bot(token, { client: { apiRoot: process.env.TELEGRAM_API_URL } })`.
   Telegraf da: `new Telegraf(token, { telegram: { apiRoot: process.env.TELEGRAM_API_URL } })`.
3. Barcha kutubxonalar aniq versiyasi bilan: Python — `requirements.txt` da `==` bilan (masalan
   `aiogram==3.15.0`); Node.js — `package.json` da aniq versiya (`"grammy": "1.31.0"`, `"*"` yoki
   `"latest"` emas).
4. Kirish nuqtasi aniq bo'lsin: Python — `main.py` (yoki `botxona.yaml` da `entry`/`start`); Node.js
   — `package.json` da `"scripts": {"start": "node index.js"}`.
5. Barcha doimiy ma'lumotlar (SQLite baza, JSON fayllar, eksportlar) **faqat** `DATA_DIR` papkasida
   saqlansin (standart `./data`, ishlab chiqarishda `/data`). Boshqa hech qanday joyga yozma — bot
   konteynerida fayl tizimi `DATA_DIR` va `/tmp`dan tashqari **faqat o'qish uchun**. Papkani ishlatishdan
   oldin yarating: Python — `os.makedirs(DATA_DIR, exist_ok=True)`; Node.js —
   `fs.mkdirSync(dataDir, { recursive: true })`.
6. Barcha sozlamalar (custom o'zgaruvchilar) `.env.example` faylida qisqa izoh bilan
   hujjatlashtirilsin: `BOT_TOKEN`, `TELEGRAM_API_URL`, `DATA_DIR` va botga xos boshqa barcha
   o'zgaruvchilar (masalan `ADMIN_IDS`).

**Yana muhim qoidalar (ko'p AI shu joyda xato qiladi):**

- Bot **faqat long polling** bilan ishlasin (`start_polling` / `bot.start()` / `bot.launch()` /
  `infinity_polling()`). **Hech qachon `setWebhook` chaqirma**, hech qachon Telegram
  yangilanishlarini qabul qilish uchun HTTP server yoki port ochma — Botxona bunday holatda
  webhookni jimgina e'tiborsiz qoldiradi va bot hech qanday xabar olmaydi (lekin tashqaridan hammasi
  yaxshi ko'rinadi).
- Loglarni faqat stdout/stderr ga yoz (`print`, `console.log`, `logging`) — fayl loglar kerak bo'lsa
  ham `DATA_DIR` ichida bo'lsin.
- Bajariladigan/binar fayllar (`.exe`, `.dll`, `.so`, oldindan build qilingan narsalar) qo'shma —
  Botxona faqat manba kodni (Python/Node.js) o'zi build qiladi.
- Bot logikasini o'zgartirmasdan, faqat yuqoridagi talablarga moslashtir.

**Natijada quyidagilarni ber:**

1. Har bir o'zgargan (yoki yangi) faylni **to'liq** kodi bilan alohida blokda (diff emas — butun
   fayl matni, foydalanuvchi to'g'ridan-to'g'ri almashtira olishi uchun).
2. Har bir standart (1–6) bo'yicha bitta qatorlik holat: masalan
   "1. Token — tuzatildi (endi BOT_TOKEN dan o'qiladi)" yoki "5. DATA_DIR — allaqachon to'g'ri edi".
3. Foydalanuvchi texnik odam bo'lmasligi mumkinligini hisobga olib, oddiy o'zbek tilida, raqamlangan
   "Keyingi qadamlar" ro'yxati bilan tugat, masalan:

```
Keyingi qadamlar:
1. https://botxona.uz saytiga kiring va "Bot qo'shish" tugmasini bosing.
2. @BotFather dan olingan tokenni kiriting.
3. Yuqoridagi fayllardan tayyorlangan ZIP arxivni yuklang.
4. "Sozlamalar" bo'limida .env.example dagi qiymatlarni to'ldiring.
5. 15 daqiqalik bepul sinovdan foydalaning, keyin mos tarifni tanlab to'lovni amalga oshiring.
```

Mana bot kodi (yoki tavsifi):

```
[KODNI YOKI TAVSIFNI SHU YERGA QO'YING]
```

---

## PROMPT (English)

You are an experienced Telegram bot developer. Adapt the bot code I'm about to paste (or write a
new one from the description below) so it deploys cleanly on **Botxona** (https://botxona.uz).
Don't change the bot's actual behaviour/logic — only adapt it to the requirements below.

**Botxona mandatory standards:**

1. Token only from the `BOT_TOKEN` environment variable — never hardcoded in source.
2. Telegram API base only from `TELEGRAM_API_URL` (default fallback `https://api.telegram.org` is
   fine only as a same-line default for when the variable is unset).
3. Every dependency pinned to an exact version (`requirements.txt` with `==`, or
   `package.json` with an exact/compatible version — never `*`/`latest`).
4. One unambiguous entry point (`main.py`, or `package.json` `scripts.start`).
5. All persistent data written only under `DATA_DIR` (default `./data`; the production filesystem
   is read-only outside `DATA_DIR` and `/tmp`) — create the directory before first use.
6. Every custom setting documented with a short comment in `.env.example`, alongside placeholder
   lines for `BOT_TOKEN`, `TELEGRAM_API_URL`, `DATA_DIR`.

**Also critical:** the bot must run **long polling only** — never call `setWebhook`, never start an
HTTP server or open a port to receive Telegram updates (Botxona silently no-ops any `setWebhook`
call, so a webhook-based bot will appear to deploy fine but will never receive any message). Log to
stdout/stderr only. No compiled binaries in the project — Botxona builds pure Python/Node.js source.

**Deliverable:** return every changed/new file in full (not a diff), one status line per rule
(1–6) saying whether it was already fine or what you changed, and end with a numbered, plain-language
next-steps list a non-technical bot owner can follow (BotFather token → botxona.uz → upload the ZIP
→ fill the settings shown in `.env.example` → 15-minute free trial → pick a tariff and pay).

Here is the bot code (or description):

```
[PASTE YOUR CODE OR DESCRIPTION HERE]
```
