Rename workspace packages and update Rust imports and usage examples
This commit is contained in:
@@ -7,7 +7,7 @@ Rust keyword search for public Telegram channels, groups, bots and posts. The ex
|
||||
From the workspace root:
|
||||
|
||||
```sh
|
||||
cargo run -p telefind-app -- query - '/search type:video 上海相机' <<'JSONL'
|
||||
cargo run -p app -- query - '/search type:video 上海相机' <<'JSONL'
|
||||
{"op":"upsert","kind":"post","id":-100501,"message_id":42,"username":"example_feed","title":"相机入门.mp4","body":"上海 摄影","media":"video"}
|
||||
JSONL
|
||||
```
|
||||
@@ -19,7 +19,7 @@ This prints the reply as JSON, including a button with the URL `https://t.me/exa
|
||||
Supply the bot token through the environment variable `TELEGRAM_BOT_TOKEN` and run:
|
||||
|
||||
```sh
|
||||
cargo run -p telefind-app -- bot events.jsonl
|
||||
cargo run -p app -- bot events.jsonl
|
||||
```
|
||||
|
||||
The input file is optional. The process identifies its username via `getMe`, then long-polls for incoming messages and sends search results with URL buttons. Type keywords in private chat or use `/search@YourBot keywords` in a group. In a public channel where the bot receives posts, incoming posts and edits update the in-memory index. For channels without a public username, protected posts and unsupported content, the bot skips indexing the message. Telegram does not send ordinary post-deletion notifications via this update stream. An upstream source can supply deletion events. If a reply reached Telegram but its HTTP acknowledgement was lost, retrying an update can send the reply twice.
|
||||
@@ -34,7 +34,7 @@ Pass an ordered UTF-8 JSONL stream in a file, or pass `-` to read standard input
|
||||
{"op":"delete","kind":"post","id":-100501,"message_id":42}
|
||||
```
|
||||
|
||||
The process keeps no database or history archive. Restarting loads whichever input the caller supplies. For a persistent or concurrent host, implement `telefind_core::index::IndexStore` and its snapshot reader, then use `Engine::new(store)`. Pass the resulting engine to `telefind_app::telegram::run` with a `telefind_app::telegram::Client` to reuse the same polling and reply logic. The JSONL reader `telefind_app::input::load` also accepts any implementation of `SearchIndex`.
|
||||
The process keeps no database or history archive. Restarting loads whichever input the caller supplies. For a persistent or concurrent host, implement `search_core::index::IndexStore` and its snapshot reader, then use `Engine::new(store)`. Pass the resulting engine to `app::telegram::run` with a `app::telegram::Client` to reuse the same polling and reply logic. The JSONL reader `app::input::load` also accepts any implementation of `SearchIndex`.
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
Reference in New Issue
Block a user