getChatMember
Obtiene información de un miembro del chat.
Devuelve: Si la llamada tiene éxito, devuelve ChatMember.
Parámetros
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
chat_id | Integer or String | Sí | ID del chat |
user_id | Integer | Sí | ID del usuario |
Ejemplo de solicitud
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/getChatMember" \
-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}/getChatMember",
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}/getChatMember`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"user_id": 123456789
}),
});
console.log(await res.json());
Guía paso a paso: Cómo crear un bot en Telegram paso a paso: de BotFather a tu primer mensaje
Métodos relacionados
getChatObtiene información del chat.getChatMemberCountDevuelve la cantidad de miembros del chat.getChatAdministratorsDevuelve la lista de administradores del chat.setChatTitleEstablece el título del chat.setChatDescriptionEstablece la descripción del chat.setChatPhotoEstablece la foto del chat.deleteChatPhotoElimina la foto del chat.setChatPermissionsEstablece los permisos del chat.leaveChatSale de un chat.exportChatInviteLinkExporta el enlace de invitación principal del chat.createChatInviteLinkCrea un enlace de invitación.editChatInviteLinkEdita un enlace de invitación.