Telegram Bot API
🌐 Tiếng Việt

promoteChatMember

Danh mục: Quản trị · Bot API 10.3 · Tài liệu chính thức

Thăng cấp thành viên chat lên quản trị viên.

Giá trị trả về: Nếu thành công, trả về True.

Tham số

Tham sốKiểuBắt buộcMô tả
chat_idInteger or StringCóID chat
user_idIntegerCóID người dùng
is_anonymousBooleanTùy chọnQuản trị viên ẩn danh
can_manage_chatBooleanTùy chọnCó thể quản lý chat
can_delete_messagesBooleanTùy chọnCó thể xóa tin nhắn
can_manage_video_chatsBooleanTùy chọnCó thể quản lý video chat
can_restrict_membersBooleanTùy chọnCó thể hạn chế thành viên
can_promote_membersBooleanTùy chọnCó thể thăng cấp thành viên
can_change_infoBooleanTùy chọnCó thể thay đổi thông tin chat
can_invite_usersBooleanTùy chọnCó thể mời người dùng
can_post_storiesBooleanTùy chọnCó thể đăng story
can_edit_storiesBooleanTùy chọnCó thể chỉnh sửa story
can_delete_storiesBooleanTùy chọnCó thể xóa story
can_post_messagesBooleanTùy chọnCó thể đăng tin nhắn (kênh)
can_edit_messagesBooleanTùy chọnCó thể chỉnh sửa tin nhắn (kênh)
can_pin_messagesBooleanTùy chọnCó thể ghim tin nhắn
can_manage_topicsBooleanTùy chọnCó thể quản lý chủ đề
can_manage_direct_messagesBooleanTùy chọnCó thể quản lý tin nhắn trực tiếp (Bot API 10.0)
can_manage_tagsBooleanTùy chọnCó thể quản lý thẻ (Bot API 9.5)
can_send_welcome_messagesBooleanTùy chọnCó thể quản lý tin nhắn chào mừng của chat (Bot API 10.3)

Mô tả tham số chỉ là bản tóm tắt ngắn gọn; xem tài liệu chính thức để đọc toàn văn.

Ví dụ request

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/promoteChatMember" \
  -H "Content-Type: application/json" \
  -d '{"chat_id":123456789,"user_id":123456789}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/promoteChatMember",
    json={
        "chat_id": 123456789,
        "user_id": 123456789
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/promoteChatMember`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chat_id": 123456789,
    "user_id": 123456789
  }),
});
console.log(await res.json());

Hướng dẫn từng bước: Cách tạo bot Telegram từ A đến Z: BotFather, token và tin nhắn đầu tiên