Skip to content

editGeneralForumTopic

Returns: TrueOfficial docs ↗

Use this method to edit the name of 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. Returns True on success.

Parameters

chat_idIntegerStringRequired
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
nameStringRequiredminLen 1maxLen 128
New topic name, 1-128 characters

Returns

On success, True is returned.

GramIO Usage

ts
// Rename the General topic
await 
bot
.
api
.
editGeneralForumTopic
({
chat_id
: -1001234567890,
name
: "Welcome & Announcements",
});
ts
// Rename by username — works for public supergroups
await 
bot
.
api
.
editGeneralForumTopic
({
chat_id
: "@mysupergroup",
name
: "General Chat",
});
ts
// Restore the default name after a custom rename
bot
.
command
("reset_general", async (
ctx
) => {
await
bot
.
api
.
editGeneralForumTopic
({
chat_id
:
ctx
.
chat
.
id
,
name
: "General",
}); await
ctx
.
send
("General topic name has been reset.");
});

Errors

CodeErrorCause
400Bad Request: chat not foundInvalid chat_id or the bot is not a member of the chat
400Bad Request: method is available only in supergroupsTarget chat is not a forum supergroup — forums must be enabled in the group settings
400Bad Request: not enough rights to manage topicsBot lacks the can_manage_topics administrator right
400Bad Request: TOPIC_NAME_INVALIDname is empty or exceeds 128 characters
403Forbidden: not enough rightsBot is not an administrator in the supergroup
429Too Many Requests: retry after NRate limit hit — check retry_after, use auto-retry plugin

TIP

Use GramIO's auto-retry plugin to handle 429 errors automatically.

Tips & Gotchas

  • The General topic has its own dedicated method. Unlike regular topics, the General topic cannot be edited with editForumTopic — use this method instead.
  • name is required and must be 1–128 characters. Unlike regular topics where name can be omitted to keep the current value, this method always requires a non-empty name.
  • The General topic cannot have a custom icon. Only regular forum topics support icon_custom_emoji_id — the General topic always uses the default icon.
  • Bot must have can_manage_topics admin right. This is distinct from can_edit_messages or other admin rights.
  • Forums must be enabled on the supergroup. If the group doesn't have the forum mode active, the method will fail with a supergroup-only error.
  • chat_id accepts @username strings for public supergroups. Private supergroups always require the numeric chat ID.

See Also