Skip to content

removeMyProfilePhoto

Returns: TrueOfficial docs ↗

Removes the profile photo of the bot. Requires no parameters. Returns True on success.

Returns

On success, True is returned.

GramIO Usage

ts
// Remove the bot's profile photo (no parameters needed)
await 
bot
.
api
.
removeMyProfilePhoto
();
ts
// Remove the profile photo in a command handler
bot
.
command
("resetphoto", async (
ctx
) => {
await
bot
.
api
.
removeMyProfilePhoto
();
await
ctx
.
reply
("Bot profile photo removed.");
});
ts
// Pair with setMyProfilePhoto to rotate/update the bot avatar
bot
.
command
("clearphoto", async (
ctx
) => {
try { await
bot
.
api
.
removeMyProfilePhoto
();
await
ctx
.
reply
("Profile photo cleared successfully.");
} catch { await
ctx
.
reply
("Failed to remove profile photo — it may already be unset.");
} });

Errors

CodeErrorCause
400Bad Request: PHOTO_INVALIDThe bot does not currently have a profile photo set — safe to ignore
429Too Many Requests: retry after NRate limit hit — check retry_after and use the auto-retry plugin

Tips & Gotchas

  • No parameters required. removeMyProfilePhoto() takes no arguments — just call it directly.
  • Idempotent in practice but may throw. If the bot has no profile photo, the API may return an error rather than silently succeeding. Wrap the call in a try/catch if the state is uncertain.
  • Pair with setMyProfilePhoto. Use setMyProfilePhoto to upload a new photo, then removeMyProfilePhoto to reset it. Together they give you full lifecycle control over the bot's avatar.
  • Changes are visible immediately. After a successful call, Telegram updates the bot's avatar everywhere without any delay.

See Also