3 min read
Telegram
Expose message attachments in a channel or group as files. Supports downloading, sending files, and deleting messages when authorized, without traditional directory operations.
Adapter type: telegram. See Common configuration for mounting instructions.
Setup
- Sign in to my.telegram.org and create an app under API development tools to obtain
api_idandapi_hash. - Open the Telegram session tool, use your app credentials, phone number, login code, and two-step password if required to generate
session_string. - Join the target channel or group with that account. Set
chat_idto its public username or numeric chat ID, such as-1001234567890. - If the Foxel server cannot reach Telegram directly, configure a proxy reachable from that server, supplying protocol, host, and port together.
Configuration
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
api_id | string | Yes | — | Telegram application API ID as a numeric string. |
api_hash | password | Yes | — | API Hash for the same Telegram application. |
session_string | password | Yes | — | Complete authenticated user session string, not a bot token. |
chat_id | string | Yes | — | Numeric channel/group ID or public username. |
proxy_protocol | string | No | — | Proxy protocol: socks5 or http. |
proxy_host | string | No | — | Proxy host reachable from the Foxel server. |
proxy_port | number | No | — | Proxy port; supply together with protocol and host. |
Example
This is a config object. In the admin form, fill the corresponding fields rather than pasting the whole object. Replace credential placeholders with your own values.
json
{
"api_id": "123456",
"api_hash": "YOUR_API_HASH",
"session_string": "YOUR_SESSION_STRING",
"chat_id": "-1001234567890"
}
Behavior and limitations
- Names resemble
123_document.pdf, where the prefix is the message ID. Plain-text messages are not regular attachments. - Uploading sends a new message and may change the returned filename. Deleting a file deletes its message and requires permission.
- Directory creation, moves, renames, and copies are unsupported. Common
sub_pathdoes not divide a channel into folders. - A session is an account login credential; regenerate it after revoking that Telegram session.
Troubleshooting
- Invalid session: regenerate the complete string; the adapter accepts Telethon StringSession and the compatible session produced by the tool.
- Chat missing: verify that the session account has joined; a private group display name is insufficient.
- FloodWait / 429: wait as instructed and reduce concurrency and refresh frequency.
- Proxy fails:
127.0.0.1inside a container refers to that container, not the host proxy.
References
External documentation provides service and authorization context. Use this page and the current Foxel adapter for configuration fields and limitations.