Middleware ID: catbaron.search_msg
SearchMessage is a middleware for EFB, to search message from the chat history.
SearchMessage 是用来搜索历史消息的中间件.
Usually, you may have trouble to search messages with Chinses key words in Telegram clients,
thus here is the middleware could help you out.
由于 Telegram 对中文没有做分词,关键词搜索几乎不可用。所以写了个中间件用来搜索消息。
Be aware that this is a very early develop version. Please let me know if you found any problem.
注意,这是初期版本可能会不稳定。(也可能没有稳定版本了)
You need to use SearchMessage on top of EFB. Please check the document and install EFB first.
请先装 EFB。
pip install efb-search_msg-middleware
~/.ehforwarderbot/profiles/default/config.yaml
. It should look like:装完之后需要在 EFB 的配置文件注册一下中间件。默认在这 ~/.ehforwarderbot/profiles/default/config.yaml
master_channel: foo.demo_master
slave_channels:
- foo.demo_slave
- bar.dummy
middlewares:
- foo.other_middlewares
- catbaron.search_msg
You only need to add the last line to your config file.
基本上只要加上最后一行就够了。
这个中间件提供了一些选项。第一个基本上不用改。第二个是每次展示的搜索结果数量。改成 0 是没有限制。
The config file by default is $HOME/.ehforwarderbot/profiles/default/catbaron.search_msg/config.yaml
.
Please create the config file if thers is not one. Edit it as:
# The name of master channel
master: 'blueset.telegram'
# The max number of message the middleware would show you.
# Set it to 0 for no limitation.
max_num: 15
\sr [key_word] [from:datetime] [to:datetime]
key_word
: text without whitespace charactersdatetime
: Datetime string, such as 1989-6
, 2008-8-8 12:0
. Note that from:
and to:
are necessary and there should be no space in this argument. Messages of last 15 days will be searched by default.key_word
: 搜索用的关键字datetime
: 表示时间的字符串, 比如 1989-6
, 或者 2008-8-8 12:0
. from:
和 to:
表示搜索的时间范围。注意所有参数内部都不要有空白字符。None
in the database, so it’s not always reliable. 这是一条被空格分开 的消息
, to locate this message, you coulde search the entire message, 这是一条被空格分开
or 的消息
in Telegram.这是一条被空格分开 的消息
, 你可以再 Telegram 里面搜索整条消息多全文,或者搜索 这是一条被空格分开
或者 的消息
.