---
title: Telegram
icon: paper-plane
description: Set up the Telegram resource in Python.
---

## Dependencies

No additional dependencies - uses `aiohttp` (included).

For credential setup, see the [Telegram Setup](/home/setup/telegram) guide.

## Configuration

```python
import os
from mirage import Workspace, MountMode
from mirage.resource.telegram import TelegramConfig, TelegramResource

config = TelegramConfig(token=os.environ["TELEGRAM_BOT_TOKEN"])
resource = TelegramResource(config=config)
ws = Workspace({"/telegram/": resource}, mode=MountMode.READ)
```

> **Important:** Telegram bots have a 24-hour message window limitation.
> The bot can only fetch messages from the last 24 hours of updates it
> has received. Older messages may not be available.

## Config Reference

| Field   | Required | Description        |
| ------- | -------- | ------------------ |
| `token` | Yes      | Telegram Bot Token |
