Skip to content

setChatDescription

Returns: TrueOfficial docs ↗

Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Parameters

chat_idIntegerStringRequired
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
descriptionStringOptionalminLen 0maxLen 255
New chat description, 0-255 characters

Returns

On success, True is returned.

GramIO Usage

ts
// Set a description for a channel or supergroup
await 
bot
.
api
.
setChatDescription
({
chat_id
: "@mychannel",
description
: "The official GramIO community — TypeScript Telegram bot framework.",
});
ts
// Clear the description by omitting the field (or passing an empty string)
await 
bot
.
api
.
setChatDescription
({
chat_id
: -1001234567890,
// description omitted → clears existing description });
ts
// From a message context — update the current chat's description
bot
.
command
("setdesc", async (
ctx
) => {
const
newDesc
=
ctx
.
text
?.
split
(" ").
slice
(1).
join
(" ") ?? "";
await
ctx
.
setChatDescription
(
newDesc
);
await
ctx
.
send
("Description updated!");
});

Errors

CodeErrorCause
400Bad Request: chat not foundInvalid or inaccessible chat_id
400Bad Request: chat description is not modifiedThe new description is identical to the current one
400Bad Request: CHAT_ABOUT_TOO_LONGdescription exceeds 255 characters
403Forbidden: not enough rights to change chat descriptionBot lacks the can_change_info admin right
403Forbidden: bot is not a member of the channel chatBot was removed from the channel

Tips & Gotchas

  • can_change_info right is required. The bot must be an admin with the can_change_info flag set to true. Without it, the call returns 403 not enough rights.
  • Groups, supergroups, and channels only. Private chats do not support a description field; this method will error on them.
  • Omitting description clears it. Passing description: "" or simply not including the parameter removes the current description — useful for resetting it.
  • 255-character limit. Anything longer returns CHAT_ABOUT_TOO_LONG. Trim before calling if the source is user-provided text.
  • Context shorthand is ctx.setChatDescription(description). Available in MessageContext and other contexts with ChatControlMixin; chat_id is inferred automatically.

See Also