ZaminDocs

Bot profili

getMyCommands

Joriy buyruqlar ro'yxatini qaytaradi.

GEThttps://api.zamin.app/bot<TOKEN>/getMyCommands

POST ham ishlaydi. Parametrlar: query, JSON, form yoki multipart — batafsil.

Botning joriy buyruqlar ro'yxati (BotCommand massivi). Ro'yxat bo'sh bo'lsa — [].

Parametrlar

Parametrlar yo'q.

Javob

Natija (result): Array of BotCommand

JSON
{
  "ok": true,
  "result": [
    {"command": "start", "description": "Boshlash"},
    {"command": "help", "description": "Yordam"}
  ]
}

Xatolar

Bu metodga xos xato yo'q.

Istalgan metodda bo'lishi mumkin: 401 Unauthorized, 403 Forbidden: bot is suspended, 429 Too Many Requests, 400 Bad Request: <maydon>: … — xato kodlari.

Misol

Python
import os
import requests

TOKEN = os.environ["ZAMIN_BOT_TOKEN"]
API = f"https://api.zamin.app/bot{TOKEN}"

for cmd in requests.get(f"{API}/getMyCommands", timeout=15).json()["result"]:
    print(f"/{cmd['command']} — {cmd['description']}")
curl
curl -s "https://api.zamin.app/bot$ZAMIN_BOT_TOKEN/getMyCommands"