Warning
This project is deprecated. You can use instead https://github.com/yazdipour/TelegramToTRMNL which is a bit cleaner version of this project with more feature like pdf and epub reader.
π‘ Telegram β TRMNL Image Forwarder
This project lets you forward images from Telegram directly to a TRMNL device display using a Pipedream integration.
It listens for incoming Telegram messages with images and captions, extracts the image and formatting info (CSS classes and styles), then sends that to your TRMNL plugin.
β¨ What It Does
-
You send an image to a Telegram bot.
-
Optionally, you include a caption with CSS-like formatting:
.classNameis extracted asimg_class- anything else is added as inline
img_style
-
The bot grabs the image URL and formats a payload:
{ "merge_variables": { "img_url": "https://...", "img_class": "your-class", "img_style": "width:100%" } } -
This payload is sent to your TRMNL plugin and displayed.
Available CSS Classes
.invert- Enhances image brightness and saturation.rotate- Rotates image 90Β° clockwise
π Setup Instructions
β Complete setup takes ~10β15 minutes
1. π Set Up Your TRMNL Plugin
- Visit usetrmnl.com
- Go to Dashboard β Plugins
- Click β+ Add Pluginβ
- Choose Custom Plugin and create Private Plugin with Webhook.
- Copy your pluginβs UUID which you'll need it later.
- Setup Markup by copying the content of the Markup.html (Can use it shared between different views)
2. π€ Create a Telegram Bot
-
Open @BotFather on Telegram
-
Send
/newbotand follow the prompts -
You'll receive a Bot Token, like:
6119652656:AAxxxxx...
Save this for the Pipedream step.
3. βοΈ Set Up the Pipedream Workflow
Youβll use Pipedream.com to glue it all together
Step A: Connect Telegram
- Go to Pipedream Telegram integrations
- Click βConnect Accountβ
- Paste your Telegram Bot Token when prompted
Step B: Import the Component
- Create a new workflow in Pipedream
- Choose Trigger: Telegram β New Message
- Add a new βRun Node.js Codeβ step
- Paste the code from 'src.js` (in this repo)
- In the step config:
- Select your Telegram bot
- Set
plugin_idto the TRMNL plugin UUID you copied earlier
Step C: Deploy
- Save and deploy the workflow
- Start sending images to your bot!
π Privacy & Security
- Telegram file links are temporary and not public
- You do not need to upload images to third-party services
- No cloud image hosting needed β all via Telegram CDN
π Need Help?
If you have issues setting up TRMNL, Telegram Bot, or Pipedream:
- Check the TRMNL Docs
- Use @BotFather to regenerate your token
- Visit Pipedream Support
- We are also open to contributions and improvements! So feel free to open issues or PRs.
Made with π» by [Shahriar Yazdipour]


