Telegram Bot API
🌐 فارسی

closeForumTopic

دسته‌بندی: انجمن · Bot API 10.3 · مستندات رسمی

تاپیک انجمن را می‌بندد.

مقدار بازگشتی: در صورت موفقیت، True برمی‌گرداند.

پارامترها

پارامترنوعالزامیتوضیحات
chat_idInteger or Stringبلهشناسه چت یا @username
message_thread_idIntegerبلهشناسه تاپیک انجمن

توضیحات پارامترها خلاصه‌اند؛ متن کامل را در مستندات رسمی ببینید.

نمونه درخواست

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/closeForumTopic" \
  -H "Content-Type: application/json" \
  -d '{"chat_id":123456789,"message_thread_id":7}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/closeForumTopic",
    json={
        "chat_id": 123456789,
        "message_thread_id": 7
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/closeForumTopic`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chat_id": 123456789,
    "message_thread_id": 7
  }),
});
console.log(await res.json());

راهنمای گام‌به‌گام: ساخت ربات تلگرام: آموزش قدم‌به‌قدم از BotFather تا اولین پیام با Python