approveChatJoinRequest
Phê duyệt yêu cầu tham gia.
Giá trị trả về: Nếu thành công, trả về True.
Tham số
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
chat_id | Integer or String | Có | ID chat |
user_id | Integer | Có | ID người dùng |
Ví dụ request
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/approveChatJoinRequest" \
-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}/approveChatJoinRequest",
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}/approveChatJoinRequest`, {
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
Phương thức liên quan
getChatLấy thông tin chat.getChatMemberLấy thông tin thành viên chat.getChatMemberCountTrả về số lượng thành viên chat.getChatAdministratorsTrả về danh sách quản trị viên của chat.setChatTitleĐặt tiêu đề chat.setChatDescriptionĐặt mô tả chat.setChatPhotoĐặt ảnh chat.deleteChatPhotoXóa ảnh chat.setChatPermissionsĐặt quyền trong chat.leaveChatRời khỏi chat.exportChatInviteLinkXuất liên kết mời chính của chat.createChatInviteLinkTạo liên kết mời.