---
name: telegram-bot-profile
description: Configure a Telegram bot's profile — name, bio, short description, and avatar. Use when setting up a new bot identity or updating an existing bot's public-facing profile.
version: 1.0.0
author: Ezra
license: MIT
metadata:
  hermes:
    tags: [telegram, bot, profile, avatar, identity, setup]
    related_skills: [hermes-agent-setup]
---

# Telegram Bot Profile Setup

## When to Use

- Setting up a new Telegram bot's identity (name, bio, avatar)
- Updating an existing bot's public-facing profile
- Configuring wizard house bots or agent bots on Telegram

## What Works via Bot API (programmatic)

These three methods work reliably via HTTP POST with JSON body:

```bash
# Set display name (shown in chats)
curl -s -X POST "https://api.telegram.org/bot${TOKEN}/setMyName" \
  -H "Content-Type: application/json" \
  -d '{"name": "BotDisplayName"}'

# Set description (shown when user first opens chat, before sending a message)
curl -s -X POST "https://api.telegram.org/bot${TOKEN}/setMyDescription" \
  -H "Content-Type: application/json" \
  -d '{"description": "Full bio text shown in the bot info panel."}'

# Set short description (shown in profile popup and search results)
curl -s -X POST "https://api.telegram.org/bot${TOKEN}/setMyShortDescription" \
  -H "Content-Type: application/json" \
  -d '{"short_description": "One-liner shown in profile card."}'
```

All three return `{"ok": true, "result": true}` on success.

Verify with the corresponding GET methods:
```bash
curl -s "https://api.telegram.org/bot${TOKEN}/getMyName"
curl -s "https://api.telegram.org/bot${TOKEN}/getMyDescription"
curl -s "https://api.telegram.org/bot${TOKEN}/getMyShortDescription"
curl -s "https://api.telegram.org/bot${TOKEN}/getMe"  # canonical bot info
```

## What Does NOT Work: Profile Photo

As of March 2026, `setMyProfilePhoto` does NOT work via any programmatic method:

- curl multipart form upload: returns "photo isn't specified"
- Python urllib multipart: same error
- python-telegram-bot library `set_my_profile_photo()`: same error
- Wrapping in InputFile: same error

The method exists in the API docs but appears non-functional on standard Bot API servers.

### The Only Way to Set a Bot Avatar

1. Generate the image and save it locally
2. Send the image file to the user (via MEDIA:/path/to/avatar.png)
3. User forwards it to @BotFather -> `/setuserpic` -> selects the bot
4. Takes 10 seconds manually

This is a BotFather-only operation. Do not waste iterations trying programmatic approaches.

## Pitfalls

1. **Name length**: Bot display names have a max length (~64 chars). Keep it short.
2. **Description vs Short Description**: Description is the full bio (shown before first message). Short description is the one-liner in profile cards and search.
3. **Unicode works**: Hebrew, emoji, and other Unicode characters work fine in all three text fields.
4. **Rate limits**: These profile methods are rarely rate-limited but don't call them in tight loops.
5. **execute_code sandbox**: If generating avatar images with PIL in Hermes's execute_code, the sandbox uses a separate venv. Install Pillow to /tmp and add to sys.path:
   ```python
   import subprocess
   subprocess.run(["pip3", "install", "--target=/tmp/pil_pkg", "Pillow"], capture_output=True)
   import sys
   sys.path.insert(0, '/tmp/pil_pkg')
   from PIL import Image, ImageDraw
   ```
