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_idIntegerStringRequiredUnique 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
| Code | Error | Cause |
|---|---|---|
| 400 | Bad Request: chat not found | Invalid or inaccessible chat_id — confirm the bot is a member of the supergroup |
| 400 | Bad Request: TOPIC_NOT_MODIFIED | The General topic is already hidden — no action was needed |
| 400 | Bad Request: method is available for supergroup chats only | chat_id points to a regular group or channel — only forum supergroups have a General topic |
| 403 | Forbidden: bot is not a member of the supergroup chat | Bot was removed from the chat — re-add it |
| 403 | Forbidden: not enough rights | Bot 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
400error. - The General topic closes automatically. If the General topic was open when you call
hideGeneralForumTopic, Telegram closes it silently. You don't need to callcloseGeneralForumTopicfirst. can_manage_topicsis required. Even if the bot is an admin, the specificcan_manage_topicsright must be granted — general admin rights are not enough.- Use
@usernamefor public supergroups. Thechat_idfield accepts@supergroupusernamefor public chats, avoiding the need to store numeric IDs. - Pair with
unhideGeneralForumTopic. To restore visibility, call unhideGeneralForumTopic — the same admin rights apply.
See Also
- unhideGeneralForumTopic — restore the General topic's visibility
- closeGeneralForumTopic — close the General topic without hiding it
- reopenGeneralForumTopic — reopen a closed General topic
- editGeneralForumTopic — rename the General topic
- createForumTopic — create other topics in a forum supergroup