Skip to content

hideGeneralForumTopic

Returns: TrueOfficial docs ↗

Use this method to hide the '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. The topic will be automatically closed if it was open. 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

Hide the General topic by numeric chat ID:

ts
await 
bot
.
api
.
hideGeneralForumTopic
({
chat_id
: -1001234567890 });

Hide by supergroup username:

ts
await 
bot
.
api
.
hideGeneralForumTopic
({
chat_id
: "@mysupergroup" });

Toggle the General topic visibility with a command:

ts
bot
.
command
("hide_general", async (
ctx
) => {
await
bot
.
api
.
hideGeneralForumTopic
({
chat_id
:
ctx
.
chat
.
id
});
await
ctx
.
send
("General topic is now hidden.");
});

Errors

CodeErrorCause
400Bad Request: chat not foundInvalid or inaccessible chat_id — confirm the bot is a member of the supergroup
400Bad Request: TOPIC_NOT_MODIFIEDThe General topic is already hidden — no action was needed
400Bad Request: method is available for supergroup chats onlychat_id points to a regular group or channel — only forum supergroups have a General topic
403Forbidden: bot is not a member of the supergroup chatBot was removed from the chat — re-add it
403Forbidden: not enough rightsBot is not an administrator or lacks can_manage_topics — promote the bot first

Tips & Gotchas

  • Only works in forum supergroups. Regular groups and channels do not have a General topic — calling this on a non-forum chat causes a 400 error.
  • The General topic closes automatically. If the General topic was open when you call hideGeneralForumTopic, Telegram closes it silently. You don't need to call closeGeneralForumTopic first.
  • can_manage_topics is required. Even if the bot is an admin, the specific can_manage_topics right must be granted — general admin rights are not enough.
  • Use @username for public supergroups. The chat_id field accepts @supergroupusername for public chats, avoiding the need to store numeric IDs.
  • Pair with unhideGeneralForumTopic. To restore visibility, call unhideGeneralForumTopic — the same admin rights apply.

See Also