This Telegram bot allows users to search for data via an API and provides the results as a Telegraph page. The bot responds to search commands, fetches data, and sends results back to the user.
- Responds to
/start
command with a welcome message. - Searches for data based on user input.
- Posts search results to a Telegraph page.
- Supports both public and authorized modes.
- Python 3.8+: Ensure you have Python 3.8 or higher installed on your system.
- Telegram Bot Token: You need a Telegram Bot Token from BotFather.
- API Endpoint: The bot fetches data from an external API. Ensure the API URL is available.
- Telegraph API: Used for posting search results. No additional setup is required beyond the provided account creation in the code.
-
Clone the Repository
git clone https://github.com/xskdnj/gdriveindexsearchbot.git cd gdriveindexsearchbot
-
Create a Virtual Environment
python3 -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install Dependencies
pip3 install -r requirements.txt
-
Edit
config.env
FileTELEGRAM_BOT_TOKEN=your_telegram_bot_token PUBLIC_MODE=True MESSAGE_DELETION_TIME=10 OWNER_ID=your_telegram_user_id AUTHORIZED_CHATS=comma_separated_list_of_chat_ids
-
Run the Bot
python3 bot.py
- Start Command: Send
/start
to the bot to receive a welcome message. - Search: Send any text to the bot to initiate a search. The bot will respond with search results or an error message.
Logs are available in the console. They include errors and other important messages.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Create a new Pull Request.
- Join our Telegram Channel: For further support and updates, Stark Media Hub.