Telegram Bot API
🌐 Bahasa Indonesia

setChatTitle

Kategori: Chat · Bot API 10.3 · Dokumentasi resmi

Mengatur judul chat.

Nilai kembalian: Jika berhasil, mengembalikan True.

Parameter

ParameterTipeWajibDeskripsi
chat_idInteger or StringYaID chat
titleStringYaJudul baru (1-128 karakter)

Deskripsi parameter berupa ringkasan singkat; lihat dokumentasi resmi untuk teks lengkapnya.

Contoh permintaan

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());

Panduan langkah demi langkah: Cara Membuat Bot Telegram: dari BotFather sampai Pesan Pertama