/PhotoBot

Primary LanguageJavaApache License 2.0Apache-2.0

PhotoBot

A Photo booth Telegram Bot.

This bot will watch for changes in a directory and post new images to telegram channels Telegram channel.

Compiling

  • UNIX-like (Linux, MacOS X, ...) : ./gradlew build
  • Windows : gradlew.bat build

results :

File Description
build/PhotoBot-dev.jar The latest build of the library, constant name, useful for testing.
build/libs/PhotoBot-VERSION.jar The same file with a versioned name.

Running

  • Create photobot.properties (see photobot.properties.sample)
    • token : the bot token given by BotFather.
    • ids : a comma separated list of channel ids.
      • The bot MUST be admin to post messages on a channel.
      • When the bot receive a message, it will post the channel id on the first message it receives on a new channel.
  • gradle run

Version

The version number used in the file name and available using PhotoBot.version() is generated by inspecting the git state (see com.palantir.git-version for details).

Here is an example : 1.5.7-3-g2aabbbf.dirty

  • 1.5.7 is the last tag
  • -3- we are 3 commits after the tag
  • g2aabbbf : git short hash
  • .dirty : some changes are not committed

How to release (and have a nice version number)

  1. git commit
  2. git tag -a MAJOR.MINOR.SUB -m "tag vMAJOR.MINOR.SUB"
  3. git push origin MAJOR.MINOR.SUB
  4. compile