Skip to content
This repository was archived by the owner on Sep 27, 2025. It is now read-only.

yazdipour/trmnl-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

trmnl telegram ipad send to


✨ What It Does

  1. You send an image to a Telegram bot.

  2. Optionally, you include a caption with CSS-like formatting:

    • .className is extracted as img_class
    • anything else is added as inline img_style
  3. The bot grabs the image URL and formats a payload:

    {
      "merge_variables": {
        "img_url": "https://...",
        "img_class": "your-class",
        "img_style": "width:100%"
      }
    }
  4. This payload is sent to your TRMNL plugin and displayed.

Available CSS Classes

  • .invert - Enhances image brightness and saturation
  • .rotate - Rotates image 90° clockwise

css classes


🚀 Setup Instructions

✅ Complete setup takes ~10–15 minutes


1. 🔌 Set Up Your TRMNL Plugin

  1. Visit usetrmnl.com
  2. Go to Dashboard → Plugins
  3. Click “+ Add Plugin”
  4. Choose Custom Plugin and create Private Plugin with Webhook.
  5. Copy your plugin’s UUID which you'll need it later.
  6. Setup Markup by copying the content of the Markup.html (Can use it shared between different views)

2. 🤖 Create a Telegram Bot

  1. Open @BotFather on Telegram

  2. Send /newbot and follow the prompts

  3. 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

pipedream

Step A: Connect Telegram

  1. Go to Pipedream Telegram integrations
  2. Click “Connect Account”
  3. Paste your Telegram Bot Token when prompted

Step B: Import the Component

  1. Create a new workflow in Pipedream
  2. Choose Trigger: Telegram → New Message
  3. Add a new “Run Node.js Code” step
  4. Paste the code from 'src.js` (in this repo)
  5. In the step config:
    • Select your Telegram bot
    • Set plugin_id to 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:


Made with 💻 by [Shahriar Yazdipour]

About

📡 Telegram → TRMNL Image Forwarder

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors