Python code org 𝗔⃞+
Посилання
натисніть — покажемо
натисніть — покажемо
### getChatMember — natijada can_send_welcome_messages ko'rinadi
curl -X GET "https://api.telegram.org/bot<TOKEN>/getChatMember?chat_id=<CHAT_ID>&user_id=987654321"
---
## 4. Reply Markup
### DisabledButton — disabled maydoni bilan
curl -X POST "https://api.telegram.org/bot<TOKEN>/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": <CHAT_ID>,
"text": "Tanlovni belgilang",
"reply_markup": {
"inline_keyboard": [
[
{ "text": "Faol tugma", "callback_data": "active" },
{ "text": "O'\''chirilgan", "callback_data": "inactive", "disabled": true }
]
]
}
}'
### force_reply — Inline klaviaturada
curl -X POST "https://api.telegram.org/bot<TOKEN>/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": <CHAT_ID>,
"text": "Savolga javob bering",
"reply_markup": {
"inline_keyboard": [[ { "text": "Javob berish", "callback_data": "reply_1" } ]],
"force_reply": true
}
}'
### force_reply — Reply klaviaturada
curl -X POST "https://api.telegram.org/bot<TOKEN>/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": <CHAT_ID>,
"text": "Tanlang",
"reply_markup": {
"keyboard": [[ { "text": "Ha" }, { "text": "Yo'\''q" } ]],
"resize_keyboard": true,
"force_reply": true
}
}'
---
## 5. Umumiy funksiyalar
### sendMessageDraft — can_stop va keep_on_stop bilan
curl -X POST "https://api.telegram.org/bot<TOKEN>/sendMessageDraft" \
-H "Content-Type: application/json" \
-d '{
"chat_id": <CHAT_ID>,
"text": "Yozilmoqda...",
"can_stop": true,
"keep_on_stop": true
}'
### sendRichMessageDraft — can_stop va keep_on_stop bilan
curl -X POST "https://api.telegram.org/bot<TOKEN>/sendRichMessageDraft" \
-H "Content-Type: application/json" \
-d '{
"chat_id": <CHAT_ID>,
"rich_message": { "blocks": [ { "type": "text", "text": "Tayyorlanmoqda..." } ] },
"can_stop": true,
"keep_on_stop": false
}'
### getUpdates — MessageGenerationStopped va CommunityChatJoined kabi yangilanishlarni olish
curl -X GET "https://api.telegram.org/bot<TOKEN>/getUpdates"
Javobda quyidagi kabi maydonlar keladi:
{
"update_id": 100000001,
"stopped_message_generation": {
"chat": { "id": <CHAT_ID>, "type": "private" },
"message_id": 42
}
}
```json
{
"message_id": 55,
"chat": { "id": <CHAT_ID>, "type": "supergroup" },
"community_chat_joined": {
"chat": { "id": -1009876543210, "type": "supergroup" }
}
}
### getUniqueGiftInfo — text, entities, is_private bilan
bash
curl -X GET "https://api.telegram.org/bot<TOKEN>/getBusinessConnection?business_connection_id=<CONNECTION_ID>"
Javobdagi `UniqueGiftInfo` obyekti:
json
{
"gift": { "id": "gift_001" },
"origin": "upgrade",
"text": "Tabriklaymiz!",
"entities": [ { "type": "bold", "offset": 0, "length": 11 } ],
"is_private": true
}
`
49 ·