createForumTopic
Forum konusu oluşturur.
Dönüş değeri: Başarılı olduğunda ForumTopic döndürür.
Parametreler
| Parametre | Tür | Zorunlu | Açıklama |
|---|---|---|---|
chat_id | Integer or String | Evet | Sohbet ID'si veya @username |
name | String | Evet | Konu adı (1-128 karakter) |
icon_color | Integer | İsteğe bağlı | Simge rengi (RGB, ör. 7322096) |
icon_custom_emoji_id | String | İsteğe bağlı | Simge için özel emoji ID'si |
Örnek istek
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());
Adım adım rehber: Telegram bot nasıl yapılır? BotFather ile adım adım bot oluşturma
İlgili metotlar
editForumTopicForum konusunu düzenler.closeForumTopicForum konusunu kapatır.reopenForumTopicForum konusunu yeniden açar.deleteForumTopicForum konusunu siler.editGeneralForumTopicGeneral forum konusunu düzenler.closeGeneralForumTopicGeneral forum konusunu kapatır.reopenGeneralForumTopicGeneral forum konusunu yeniden açar.hideGeneralForumTopicGeneral forum konusunu gizler.unhideGeneralForumTopicGeneral forum konusunu yeniden gösterir.getForumTopicIconStickersForum konusu simgesi çıkartmalarını döndürür.unpinAllForumTopicMessagesForum konusundaki tüm mesajların sabitlemesini kaldırır.unpinAllGeneralForumTopicMessagesGeneral konusundaki tüm mesajların sabitlemesini kaldırır.