Skip to content

krishukr/telegram-cjk-search-bot

Repository files navigation

Telegram-CJK-Search-Bot

A simple message-searching bot that supports CJK (Chinese, Japanese, Korean) languages.

Features

  • Search messages sorted by relevance.
  • Edited messages will be updated in the database as well.
  • Users can only search messages in chats they have already joined.

Quick Start

  1. Create a bot using @BotFather and save the token for later use.
  2. Edit the bot to turn ON inline mode and turn OFF privacy mode.
  3. Find a place to store all the data.
  4. wget https://raw.githubusercontent.com/krishukr/telegram-cjk-search-bot/master/docker-compose.yml
  5. Edit the docker-compose.yml file to replace TELOXIDE_TOKEN=xxx:xxx with your token obtained from BotFather.
  6. docker compose up -d
  7. Add the bot to a chat of which you are the owner or admin. Note: Supergroup only.
  8. Send the command /start@your_bot to the bot.

And you're all set! All future messages in this chat can be searched by sending your bot inline queries, like so: @your_bot filter.

Want to index historical messages as well? Just follow these steps:

  1. Export the chat messages in JSON format.
  2. Place the result.json file in the ./history directory.
  3. docker compose run --rm bot /app/import

Since there are no documents for exported messages, unexpected issues may arise during this process.

Feel free to reach me if you have any questions.

Credits

Powered by the blazing-fast Meilisearch.

Powered by the easy-to-use teloxide.

Inspired by telegram-search-bot.