A Telegram bot that provides real-time updates for currency exchange rates, gold prices, and cryptocurrency values in Iran's market. The bot updates its messages periodically to ensure users always have the latest market data.
- Real-time currency exchange rates (USD, EUR, GBP, etc.)
- Gold and coin prices (including Bahar Azadi coin)
- Cryptocurrency prices (Bitcoin, Ethereum, Tether)
- Auto-updating messages
- Persian (Jalali) date support
- State persistence between restarts
- Go 1.23.1 or higher
- A Telegram Bot Token
- A Telegram Channel or Chat ID
-
Clone the repository:
git clone https://github.com/onionj/pricebot.git cd pricebot
-
Set up environment variables:
cp .env.example .env
Edit
.env
and add your:BOT_TOKEN
: Your Telegram bot tokenCHAT_ID
: Target chat/channel IDCHANEL_NAME
: Your channel namePROXY_LINK
: (Optional) Proxy link for users
-
Install dependencies:
go mod download
go run .
Use the Makefile targets:
# Build for all platforms
make buildall
# Build for specific platform
make build-linux-amd64
make build-darwin-arm64
Run the test suite:
go test -v ./...
Run tests with race condition detection:
go test -race -v ./...
This project uses GitHub Actions for continuous integration. On every push and pull request to the master branch, it:
- Runs the test suite
- Checks for race conditions
- Verifies code builds successfully
├── price/ # Price fetching and formatting
├── telegram/ # Telegram bot implementation
├── utils/ # Utility functions (date conversion, etc.)
├── .env.example # Environment variables template
├── main.go # Application entry point
└── Makefile # Build and development commands
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.