This is a scheduled Python bot that fetches stock prices using Yahoo Finance and sends updates to a Telegram chat via a bot.
π Support This Project If you found this project useful or want to support its development, consider contributing:
- β
Gets real-time stock prices using
nsepython - β Sends formatted messages to a Telegram chat
- β Scheduled to run at 9:30 AM and 2:00 PM IST daily via GitHub Actions
- β Securely uses GitHub Secrets for bot token and chat ID
- Python 3.11
- yfinance for stock data
- Telegram Bot API
- GitHub Actions for automation
Clone this repository:
git clone https://github.com/yourusername/telegram-stock-bot.git
cd telegram-stock-bot
π€ Environment Variables
Make sure to set the following secrets in your GitHub repository:
XLSXNSE_BOT_TOKEN β Your Telegram bot token
XLSXNSE_CHAT_ID β Your Telegram chat ID (can be user or group)
These are passed automatically to the bot through GitHub Actions using the env section.
π GitHub Actions
The bot is automatically executed by a GitHub Action based on this schedule:
π 9:30 AM IST β 0 4 * * * (UTC)
π 2:00 PM IST β 30 8 * * * (UTC)
You can also manually trigger the workflow from the Actions tab in your repo.
π‘ Example Message Sent
----------> π NSE STOCKS INFO π<----------
TCS: βΉ3575.25
INFY: βΉ1455.10
RELIANCE: βΉ2811.65