Skip to content

closeGeneralForumTopic

Returns: TrueOfficial docs ↗

Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.

Parameters

chat_idIntegerStringRequired
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

Returns

On success, True is returned.

GramIO Usage

ts
// Close the General topic in a supergroup by username
await 
bot
.
api
.
closeGeneralForumTopic
({
chat_id
: "@mysupergroup",
});
ts
// Admin command to close the General topic in the current chat
bot
.
command
("closegeneral", async (
ctx
) => {
await
bot
.
api
.
closeGeneralForumTopic
({
chat_id
:
ctx
.
chatId
,
}); await
ctx
.
reply
("The General topic has been closed.");
});
ts
// Toggle: close General topic during off-hours, reopen in the morning
async function 
setGeneralTopicStatus
(
chatId
: number,
open
: boolean) {
if (
open
) {
await
bot
.
api
.
reopenGeneralForumTopic
({
chat_id
:
chatId
});
} else { await
bot
.
api
.
closeGeneralForumTopic
({
chat_id
:
chatId
});
} } // Close for the night await
setGeneralTopicStatus
(-1001234567890, false);

Errors

CodeErrorCause
400Bad Request: chat not foundchat_id is invalid or the bot cannot access the chat
400Bad Request: TOPIC_NOT_MODIFIEDThe General topic is already closed
403Forbidden: not enough rightsBot is not an admin or lacks can_manage_topics permission
400Bad Request: supergroup requiredForum topics only exist in supergroups with forum mode enabled

Tips & Gotchas

  • Only works in forum supergroups. The chat must be a supergroup with the forum mode feature enabled — not a regular group or channel.
  • No topic creator exemption. Unlike closeForumTopic, the General topic can only be closed by an admin with explicit can_manage_topics rights. Topic creator exemption does not apply here.
  • Hiding vs. closing. Closing prevents new messages. hideGeneralForumTopic hides the General topic from the topic list entirely, which is a separate operation.
  • Reopen with a dedicated method. Use reopenGeneralForumTopic to allow messages again. A regular reopenForumTopic won't work for the General topic.

See Also