Skip to content

getMyDescription

Use this method to get the current bot description for the given user language. Returns BotDescription on success.

Parameters

language_codeStringOptional
A two-letter ISO 639-1 language code or an empty string

Returns

On success, the BotDescription object is returned.

GramIO Usage

ts
// Get the bot's default description (no language filter)
const 
result
= await
bot
.
api
.
getMyDescription
({});
console
.
log
(
result
.
description
);
ts
// Get the description localised for Russian-speaking users
const 
ruResult
= await
bot
.
api
.
getMyDescription
({
language_code
: "ru" });
console
.
log
("RU description:",
ruResult
.
description
);
ts
// Read descriptions for several locales in parallel
const [
defaultDesc
,
enDesc
,
ruDesc
] = await
Promise
.
all
([
bot
.
api
.
getMyDescription
({}),
bot
.
api
.
getMyDescription
({
language_code
: "en" }),
bot
.
api
.
getMyDescription
({
language_code
: "ru" }),
]);
console
.
log
("Default:",
defaultDesc
.
description
);
console
.
log
("EN: ",
enDesc
.
description
);
console
.
log
("RU: ",
ruDesc
.
description
);
ts
// Audit description coverage before deployment
async function 
auditDescriptions
(
locales
: string[]) {
for (const
lang
of
locales
) {
const {
description
} = await
bot
.
api
.
getMyDescription
({
language_code
:
lang
,
}); const
status
=
description
? "OK" : "MISSING";
console
.
log
(`[${
lang
}] ${
status
}: ${
description
}`);
} } await
auditDescriptions
(["en", "ru", "de", "fr"]);

Errors

CodeErrorCause
401Unauthorized: invalid token specifiedBot token is wrong or revoked — check the BOT_TOKEN environment variable
429Too Many Requests: retry after NRate limit hit — check retry_after, use the auto-retry plugin

Tips & Gotchas

  • Both parameters are optional — pass an empty object {} for the default. Omitting language_code (or passing an empty string) returns the language-agnostic fallback description shown to users whose language has no dedicated override.
  • Returns an empty string, not null, when no description is set. If neither a locale-specific nor a default description has been configured with setMyDescription, description is "". Always check for this before displaying the value.
  • Locale resolution is one level deep. Telegram stores each locale independently — there is no cascading. If you set only a Russian description and call getMyDescription({ language_code: "ru" }), you get it. Any other language code returns the default (or "" if the default is also unset).
  • Language codes must be ISO 639-1. Valid examples: "en", "ru", "de". An empty string "" reads the language-agnostic default.
  • Descriptions are shown in the empty chat screen. The text appears in the Telegram UI when a user opens a chat with the bot for the first time and no messages have been sent yet.
  • Use setMyDescription to update it. Read it first with getMyDescription if you want to diff before writing.

See Also