search-bot

Crates.iosearch-bot
lib.rssearch-bot
version0.1.1
sourcesrc
created_at2023-12-21 17:03:58.28751
updated_at2023-12-21 18:26:21.526976
descriptionTelegram search bot
homepage
repositoryhttps://github.com/kolserdav/search-bot
max_upload_size
id1077244
size63,091
Sergei Kol'miller (kolserdav)

documentation

README

Rust Telegram Search Bot

This Rust kit allows you to create a Telegram bot that can search through the Search API and open other websites. Currently, search is only supported through the Google Search API.

Prerequisites

Before you start, make sure you have the following:

  • Rust installed on your system
  • A Telegram Bot API token and a Google Cloud Platform project with the necessary credentials for the Google Search API

Getting Started

  1. Install the crate:
cargo install search-bot
  1. Setup .env file from .env.example file in your [workdir]:
GOOGLE_SEARCH_API_KEY=[secret-string]
GOOGLE_SEARCH_APP_ID=[special-string]
TELOXIDE_TOKEN=[secret-string]
ALLOWED_USERS=id1,id2 # To get your id, start the bot and run command /getid
  1. Navigate to your workdir:
cd /path/to/my/workdir
  1. Run bot:

search-bot

To watch more logs set the system env variable RUST_LOG=info


Usage

To search: enter any text to the bot.
To open any site: enter to the bot a site URL starting with http:// or https://

Happy hacking!

Commit count: 6

cargo fmt