aahnik / tgcf

The ultimate tool to automate custom telegram message forwarding. Live-syncer, Auto-poster, backup-bot, cloner, chat-forwarder, duplicator, ... Call it whatever you like! tgcf can fulfill your custom needs.
https://github.com/aahnik/tgcf/wiki
MIT License
1.34k stars 797 forks source link

Custom message template #177

Open aahnik opened 3 years ago

aahnik commented 3 years ago

I want to implement captioning in a generic way so that the use cases of everybody are met.

40 Remove captions of files while sending

55 Automated Captioning Of Videos With Their Real Names

86 Dynamic custom Caption

153 Forwarding media after removing the caption

169 Caption the name of the source in the message

So, what I want to do is implement a plugin for preparing the message text as per a certain template as configured by the user.

For the user, this would be something in the lines of:

plugins:
    template: "{message}\nSent by {sender}\n{filename if filename else ''}"

The string will be compiled as a python fstring. The fstring compilation will allow people to introduce some logic in the template. We may rather use jinja for templating.

The link_preview can be set to true or false by this plugin.

Also, the wiki needs to be updated with examples of common use cases.

miltonvo commented 1 year ago

this already implemented? i need to remove photos and send only text of messages