setChatTitle
Establece el título del chat.
Devuelve: Si la llamada tiene éxito, devuelve True.
Parámetros
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
chat_id | Integer or String | Sí | ID del chat |
title | String | Sí | Nuevo título (1-128 caracteres) |
Ejemplo de solicitud
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/setChatTitle" \
-H "Content-Type: application/json" \
-d '{"chat_id":123456789,"title":"Example"}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/setChatTitle",
json={
"chat_id": 123456789,
"title": "Example"
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/setChatTitle`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"title": "Example"
}),
});
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.getChatMemberObtiene información de un miembro del chat.getChatMemberCountDevuelve la cantidad de miembros del chat.getChatAdministratorsDevuelve la lista de administradores 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.