Skip to content

Latest commit

 

History

History
80 lines (53 loc) · 2.14 KB

README.md

File metadata and controls

80 lines (53 loc) · 2.14 KB

Telegram News Bot

This is a Telegram bot that fetches the latest news and sends it directly to your chat. It is designed to keep you updated with real-time news from various sources, delivered straight to your Telegram app.

Features

  • Fetches the latest news from popular APIs (e.g., NewsAPI, RSS feeds, etc.).
  • Simple and user-friendly commands to get the news directly.
  • Sends news summaries with headlines, descriptions, and links for full articles.

Prerequisites

Before running the bot, ensure you have the following:

  • Python 3.8 or higher installed.
  • A Telegram account and a bot token from BotFather.
  • An API key from a news provider (e.g., NewsAPI).

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/telegram-news-bot.git
    cd telegram-news-bot
  2. Install the required Python dependencies:

    pip install -r requirements.txt
  3. Configure your bot by creating a .env file in the project directory and adding the following:

    BOT_TOKEN=your_telegram_bot_token
    NEWS_API_KEY=your_news_api_key
  4. Run the bot:

    python main.py

Usage

  • Start the bot by searching for it in Telegram and clicking "Start."
  • Use the following commands to interact with the bot:
    • /start - Get a welcome message and available commands.
    • /news [category] - Fetch news in the specified category (e.g., /news technology).
    • /help - Display the help message.

Project Structure

telegram-news-bot/
│
├── main.py                # Main script to run the bot
├── requirements.txt      # Python dependencies
├── .env                  # Configuration file (not included in the repo)
└── README.md             # Project documentation

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements


Happy coding! 🎉