Telegram → Discord bridge bot (aiogram + discord.py). It forwards new posts from a Telegram channel to a Discord channel.
- Text + photos (highest resolution photo is used).
- Albums (media groups) are sent as one Discord message with multiple attachments.
- Text is sent as an embed (colored sidebar) when
USE_EMBEDS=1. - A clickable footer
@channel | t.meis appended when the channel username is known.
- Docker and docker‑compose on your server/VPS.
- Telegram bot is admin in the source channel.
- Discord bot is added to the server and has
View Channel,Send Messages,Attach Filespermissions.
- In Telegram open @BotFather →
/newbot. - Create a bot and copy the token.
- Add the bot to the channel and make it admin.
Option 1 (simple):
- Forward any message from the channel to @userinfobot.
- It will return the channel
ID(usually starts with-100).
Option 2:
- Forward a message from the channel to @getmyid_bot.
- It will show the
chat_id.
- Open Discord Developer Portal → your application.
- Bot section →
Reset Token→ copy the token.
- Developer Portal → OAuth2 → URL Generator.
- Scopes: bot.
- Bot Permissions:
View Channels,Send Messages,Attach Files. - Open the generated URL and add the bot to your server.
- Enable Developer Mode in Discord (User Settings → Advanced).
- Right‑click the channel → Copy ID.
- Copy
.env.exampleto.envand fill it in. - Run:
docker-compose up -d- Logs:
docker-compose logs -fPull and run without building locally:
docker pull ghcr.io/feskolech/telegram2discord:latest
docker run -d --name tg2ds --env-file .env --restart unless-stopped ghcr.io/feskolech/telegram2discord:latestOr use docker‑compose (image is already set in docker-compose.yml):
docker-compose up -dMinimal:
TELEGRAM_BOT_TOKEN=...
DISCORD_BOT_TOKEN=...
TELEGRAM_SOURCE_CHANNEL_ID=-1001234567890
DISCORD_TARGET_CHANNEL_ID=123456789012345678
If the channel is public, the bot can usually read username automatically.
If the channel is private, there is no username and the footer will be omitted.
You can set it explicitly:
TELEGRAM_SOURCE_CHANNEL_USERNAME=testchannel
Multiple channels:
CHANNEL_MAP=-1001234567890:123456789012345678,-1002345678901:234567890123456789
CHANNEL_USERNAME_MAP=-1001234567890:testchannel,-1002345678901:otherchannel
Retry delays (fixed pauses):
RETRY_DELAYS=2,4,8,16,32
Embeds (colored text blocks):
USE_EMBEDS=1
EMBED_COLOR=0x5865F2
- Only new posts.
- If a post has photos, the bot sends one Discord message: attachments + text/footer.
- Video, polls, and other media types are not handled yet.
ALLOWED_ADMIN_IDSis reserved for future use.