Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kiwiyou/rs-lib-bot

Telegram bot for searching rust crates
https://github.com/kiwiyou/rs-lib-bot

rust telegram-bot

Last synced: 26 days ago
JSON representation

Telegram bot for searching rust crates

Awesome Lists containing this project

README

        


rs-lib-bot




Coverage Status




Look up Rust crates on Telegram!

## About

`rs-lib-bot` is a telegram bot built to search or share information of a Rust crate easily.

Though on a very early stage of development, you can talk to [`@rslibbot`](https://t.me/rslibbot) if you want to try it.

## Features

- [x] Search crates with inline queries and view its information page
- [ ] Browse docs.rs with inline buttons

## Deploying on your own

You can build `rs-lib-bot` and run as your own bot.

Before starting, you need several things:

- Telegram bot token, which you can get by talking to [@BotFather](https://t.me/BotFather)
- Public server to run https webhook service for the bot.
- You can use [ngrok](https://ngrok.com/) in case you are just testing/debugging/etc.
- Running instance of [crate-search-cache](https://github.com/kiwiyou/crate-search-cache)
- Client key for your Sentry project. (optional)

Once you are ready, clone the repository.

```bash
git clone https://github.com/kiwiyou/rs-lib-bot.git
cd rs-lib-bot
```

Then, set environment variables as follows:

```bash
export BOT_TOKEN="123456789:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export PORT="8080" # port to bind server on
export WEBHOOK_URL="https://your.public.server" # IMPORTANT: without trailing slash
export SEARCH_URL="https://your.cache.server" # IMPORTANT: without trailing slash
export SENTRY_DSN="https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.ingest.sentry.io/1234567" # optional
```

Now you can run the bot with `cargo run`.

```bash
RUST_LOG=info cargo run --release
RUST_LOG=info cargo run --release --no-default-features # If you don't use Sentry
```

## Something got wrong with the bot!

Please contact me on Telegram [@kiwiyou](https://t.me/kiwiyou) or send an email to [[email protected]](mailto:[email protected]).