Skip to content

militaernews/ptb-mn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Telegram-Bot aims to help Admins of @MilitaerNews publishing for multiple languages.

You can find it here.

Usage

🔰 German Channel (@MilitaerNews)

  • if photo, animation or video (can also be a media group) is posted:
    • translates caption of each photo, image or animation - or the first entry of a media group
    • if no hashtag is present: appends Hashtags for each flag to the caption
    • appends the language's footer attribute to the caption
    • reposts in all News channels after 20 seconds
  • if a posted text (i.e. no photo, animation, video etc.) contains #eilmeldung:
    • remove this message
    • send German Breaking News photo with caption being the text of the initial channel post
    • translates to all given languages
    • prepends the language's breaking attribute to given text
    • reposts in all News channels
  • if a posted text (i.e. no photo, animation, video etc.) contains #mitteilung:
    • remove this message
    • send German Announcement photo with caption being the text of the initial channel post
    • translates to all given languages
    • prepends the language's announce attribute to given text
    • reposts in all News channels and pins them

🔰 Memes Channel (@MilitaerMemes)

  • default behavior:
    • appends English footer the each photo, animation or video posted in this channel
  • if the caption of a posted photo, animation or video contains #de:
    • the appended footer will be in German
  • channel posts are forwarded to the German and English discussion groups

Languages

This bot posts to channels with different languages. A language consists of these attributes:

attribute type usage
lang_key str identifies a language, corresponding photos and translation
channel_id int identifier of the corresponding News channel on Telegram
footer str text to appear at the end of channel posts
breaking str hashtag for breaking news
announce str hashtag for announcements

See lang.py for the implementation.

Contribute

Contributions are welcome!

Feel free to open up an issue in which you clearly define what should be added or changed.