createForumTopic
Membuat topik forum.
Nilai kembalian: Jika berhasil, mengembalikan ForumTopic.
Parameter
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
chat_id | Integer or String | Ya | ID chat atau @username |
name | String | Ya | Nama topik (1-128 karakter) |
icon_color | Integer | Opsional | Warna ikon (RGB, mis. 7322096) |
icon_custom_emoji_id | String | Opsional | ID emoji kustom untuk ikon |
Contoh permintaan
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/createForumTopic" \
-H "Content-Type: application/json" \
-d '{"chat_id":123456789,"name":"Example"}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/createForumTopic",
json={
"chat_id": 123456789,
"name": "Example"
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/createForumTopic`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"name": "Example"
}),
});
console.log(await res.json());
Panduan langkah demi langkah: Cara Membuat Bot Telegram: dari BotFather sampai Pesan Pertama
Metode terkait
editForumTopicMengedit topik forum.closeForumTopicMenutup topik forum.reopenForumTopicMembuka kembali topik forum.deleteForumTopicMenghapus topik forum.editGeneralForumTopicMengedit topik forum General.closeGeneralForumTopicMenutup topik forum General.reopenGeneralForumTopicMembuka kembali topik forum General.hideGeneralForumTopicMenyembunyikan topik forum General.unhideGeneralForumTopicMenampilkan kembali topik forum General.getForumTopicIconStickersMengembalikan stiker ikon topik forum.unpinAllForumTopicMessagesMelepas sematan semua pesan di topik forum.unpinAllGeneralForumTopicMessagesMelepas sematan semua pesan di topik General.