# Telegram for Raycast

URL: https://www.raycast.com/ikupenov/telegram

> Browse Telegram chats, read and send messages to contacts and groups, and view or send to Saved Messages, on Mac and Windows.

- Install: raycast://extensions/ikupenov/telegram
- Author: [Iliyan Kupenov](https://www.raycast.com/ikupenov)
- Installs: 3,457
- Platforms: macOS, Windows
- Categories: Communication, AI Extensions
- Updated: 2026-11-20
- Source: https://github.com/raycast/extensions/tree/86a5e3dc08b9e9c30a9ef9c78228701ef375f3d6/extensions/telegram/

## Commands

- **Authenticate with Telegram**: Log in to your Telegram account
- **Browse Chats**: Browse all your Telegram chats and groups
- **Send Message**: Send a message to any Telegram chat or group
- **View Saved Messages**: View your Telegram saved messages
- **Send to Saved Messages**: Send a message to your Telegram saved messages

## AI tools

- **Browse Telegram Chats**: Browse available Telegram chats (private and group). Returns a list of chats with their IDs, titles, types, and last message info. Use this when you need to find a chat to send a message to or when the user asks to see their chats.
- **Read Telegram Messages**: PREFERRED TOOL for reading messages. Use this for all message reading tasks including viewing recent messages, finding what someone said, checking conversation history, or answering questions about message content. Fast and efficient. Only use analyze-messages if you need to inspect images/media attachments. IMPORTANT: Be thorough when searching for information - check BOTH private chats and group chats as the same person may be in multiple conversations. Read enough messages (increase limit if needed) to find all relevant information. When extracting specific details like times, dates, or numbers, quote the EXACT text from the message - do not paraphrase or interpret. Verify information across multiple messages if available.
- **Send Telegram Message**: Send a message to a specific Telegram chat with optional file attachment from clipboard. Always confirm with the user before sending messages. Use browse-chats tool first to get the chatId. If the user wants to send a file, ask them to copy it to the clipboard first (⌘C on the file in Finder), then set useClipboardFile to true.
- **Analyze Telegram Messages**: FALLBACK TOOL - Use ONLY when you need to inspect images, photos, or other media attachments in messages. For text-only message reading, always prefer read-messages tool instead. This tool downloads media and uses AI vision to analyze images (e.g., 'What's in this photo?', 'Read text from this image', 'Analyze this receipt'). Requires OpenRouter API key.

## README

### Telegram

A Raycast extension for viewing and sending messages to your Telegram Saved Messages.

#### Features

- 📥 **View Saved Messages**: Browse your Telegram saved messages directly in Raycast
- 📤 **Send to Saved Messages**: Quickly send notes and messages to yourself
- 🔐 **Secure Authentication**: Uses official Telegram API with session persistence

#### Setup

##### 1. Get Telegram API Credentials

Before using this extension, you need to obtain API credentials from Telegram:

1. Go to [https://my.telegram.org/apps](https://my.telegram.org/apps)
2. Log in with your phone number
3. Click on "API development tools"
4. Fill in the application details:
   - **App title**: Can be anything (e.g., "Raycast Telegram")
   - **Short name**: Can be anything (e.g., "raycast")
   - **Platform**: Choose any platform
5. Click "Create application"
6. You'll receive:
   - **api_id**: A numeric ID (e.g., 12345678)
   - **api_hash**: A 32-character hash (e.g., abcdef1234567890abcdef1234567890)

⚠️ **Important**: Keep these credentials private. Do not share them with anyone.

##### 2. Configure the Extension

1. Open Raycast preferences (⌘ + ,)
2. Navigate to Extensions → Telegram
3. Enter your credentials:
   - **API ID**: The numeric ID from step 1
   - **API Hash**: The 32-character hash from step 1

##### 3. Authenticate

1. Run the "Authenticate with Telegram" command in Raycast
2. Open Telegram on your phone: **Settings > Devices > Link Desktop Device**
3. Scan the QR code displayed in Raycast (enter your 2-Step Verification password if prompted)
4. You're all set! 🎉

The extension remembers your session between commands. If Telegram invalidates or revokes the session, the extension will offer an **Authenticate with Telegram** action so you can sign in again.

#### Commands

##### Authenticate with Telegram

Log in to your Telegram account before using the other commands, or sign in again when your saved session is no longer valid.

##### View Saved Messages

Browse your Telegram saved messages in a list view. Features:

- Search through your messages
- See message timestamps
- Copy messages to clipboard
- Refresh the list (⌘ + R)

##### Send to Saved Messages

Quickly send a message to your Telegram saved messages. Perfect for:

- Saving quick notes
- Storing links for later
- Sending reminders to yourself

#### Privacy & Security

- Your API credentials are stored securely in Raycast preferences
- Your session is stored locally using Raycast's LocalStorage API
- No data is sent to any third-party servers
- The extension connects directly to Telegram's servers

#### Troubleshooting

##### "Not Authenticated" Error

If you see this error, run the "Authenticate with Telegram" command to log in.

##### "Invalid API ID" Error

Make sure you've entered the correct API ID and API Hash in the extension preferences. The API ID should be a number, not a string.

##### "Failed to Load Messages" Error

If the extension shows **Sign In to Telegram**, use **Authenticate with Telegram** to restore access. Telegram has rejected the saved session; the error alone does not identify why it became invalid. Network errors preserve your saved session, so retry the request once connectivity returns.

#### Future Features

Coming soon:

- View all chats
- Send messages to other users and groups
- Media support (photos, files)
- Message search
- Notifications

#### License

MIT

#### Development

Run `npm test` for unit tests. To check the packaged extension, build it with the same Raycast CLI version used by the repository CI, then run:

```sh
ray build -e dist -o dist
npm run test:dist
```

The distribution test runs the built Browse Chats tool with synthetic session data and mocked network methods. It checks client construction and Telegram user recognition without signing in or connecting to Telegram.
