Telegram bot to find previous images from a chat
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
Syfaro 427135db67 Add README. 1 рік тому
.gitignore Fix a bug, improve some code, add .gitignore. 1 рік тому
README.md Add README. 1 рік тому
bot.go Fix a bug, improve some code, add .gitignore. 1 рік тому

README.md

telegram-previous-images

Uses a perceptual image hash to determine if a message has already been sent within a group chat.

Data is stored in Bolt. It records the image hash and the original Message.

Configuration

The following environment variables must be set:

  • TELEGRAM_APITOKEN - Telegram token from Botfather
  • TELEGRAM_DEBUG - If tgbotapi should print debugging messages (true/false)
  • BOLT_DBNAME - Filename for Bolt database file

Usage

After starting, add it to your chat. After setting a threshold to report on by using the command /threshold num where num is the threshold value on a range of 0 being idential to any higher number (15 is a good starting point), it will start indexing photos sent. If a photo matches a previous photo within the threshold, it will reply to the old message with the similarity.

It currently supports loading photos, documents, and URLs that link directly to an image. Hopefully in the future sites will be added to allow it to work somewhat with links that aren’t directly images.