Skip to main content

@FindInChannelBot

Telegram 的消息搜索功能不支持中日韩等语言,因为这类语言字词间不加空格。而我习惯于使用 Telegram 的频道做笔记,因此一个好用的搜索功能对我来说很重要。为了能方便地在频道内搜索,这个机器人诞生了。

The ‘Find in Conversations’ feature in Telegram does not support searching in languages like Chinese/Japanese/Korean etc., since these languages do not have spaces between words. I'm used to take notes in Telegram channels, so it's important for me to have a better search tool. I made this bot so I can find in channels easily.

Usage

/start the bot
/add a channel to the bot
/find in the channel
/setlang setting UI language
/settoken create a token for others (non-admins) to search
/cancel the current action
/help show help

The user interface language of this bot follows your Telegram settings by default (language packs on Telegram desktop, and system language settings on mobiles). Please help with translating!

Deploy

Instead of HTTP bot API, this bot uses MTProto client API. Please obtain these tokens:

You can install it via PyPI:

pip3 install -U telegram-find-in-channel-bot
Or clone this repo and install from source:
cd telegram-find-in-channel-bot
for f in tgficbot/locales/*.po; do
    mkdir -p ${f%.po}/LC_MESSAGES
    msgfmt $f -o ${f%.po}/LC_MESSAGES/main.mo
done
python3 setup.py install

Run apt install gettext if command msgfmt not found.

(Optional) If cryptg is installed, the bot will work faster:

apt update
apt install clang python3-dev
pip3 install -U cryptg

Configuration file is by default ~/.config/tgficbot.cfg, but you can specify a different location. Here's the format:

[api]
id = 123456
hash = xxxxxxxxxxxxxxxxx

[bot]
token = 123456789:xxxxxxxxxxxxxxxxxxxx

To run:

python3 -m tgficbot.main --config <config_file> --dbpath <directory_to_store_database>

The parameter following --dbpath indicates where the databases are stored. They are in ~/.cache/ if you don't specify --dbpath.

Release files for telegram-find-in-channel-bot 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for telegram-find-in-channel-bot 0.5.2
File Size Uploaded
telegram-find-in-channel-bot-0.5.2.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for telegram-find-in-channel-bot 0.5.2
File Interpreter ABI Platform
telegram_find_in_channel_bot-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 30.6 kB

Release files / telegram-find-in-channel-bot-0.5.2.tar.gz

Download URL telegram-find-in-channel-bot-0.5.2.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ab9deee5b698badb1e4864852d6541b1676a9397466476581756d1ab5a9f3455
BLAKE2b-256 checksum
How to use checksums
7b7449a916a7dd85fbee9294b8289d45e6e90ca9e1defff17a019bf63588c2b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

Release files / telegram_find_in_channel_bot-0.5.2-py3-none-any.whl

Download URL telegram_find_in_channel_bot-0.5.2-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58687f0e1b39ec4eb3cfb857a956faf9196ec7a07a7326c4fa3dc563c96a7cc2
BLAKE2b-256 checksum
How to use checksums
7a1c85641ee8beecac7ffe121716489330cdd77a4c98aa25a9422a4922292935
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page