Crypto News Bot is a Telegram bot that fetches and posts the latest cryptocurrency news from sources like CoinDesk and CoinTelegraph. The bot is designed to automate news updates and deliver them to a specified Telegram channel.
- Fetches latest cryptocurrency news from CoinDesk and CoinTelegraph.
- Posts news updates to a designated Telegram channel.
- Avoids duplicate news posts by tracking already posted articles.
- Uses rotating User-Agent headers to avoid request blocking.
- Supports manual news check via Telegram command
/checknews. - Runs periodic news checks at a configurable interval.
- Python 3.8+
- Telegram Bot API token
- A Telegram channel to post news updates
-
Clone the repository:
git clone https://github.com/thisisryem/Crypto-News-Bot.git cd Crypto-News-Bot -
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
export BOT_TOKEN='your-telegram-bot-token'
-
Run the bot:
python main.py
BOT_TOKEN: Your Telegram bot's API token (required).CHANNEL_ID: The Telegram channel where news will be posted (required).NEWS_CHECK_INTERVAL: Interval (in seconds) for automated news checks. Default is 3600 seconds (1 hour).
- Start the bot: Run
python main.py. - Check news manually: Send
/checknewscommand in the Telegram bot chat. - Stop the bot: Use
CTRL + Cin the terminal.
The bot logs activities such as fetching news, errors, and posted articles. Logs are printed to the console for monitoring and debugging.
This project is licensed under the GNU GENERAL PUBLIC LICENSE
Feel free to open issues or submit pull requests to improve the bot.