This project is a Telegram bot that provides real-time cryptocurrency price updates and alerts using the Binance API.
- Get the current price of a cryptocurrency.
- Get detailed price changes over different time intervals (2 hours, 12 hours, 24 hours). (change the symbols in the code with your willing or make it more user friendly)
- Restrict bot access to specific admins.
- Send alerts based on significant price changes.
- Python 3.11
- The required Python packages are listed in the
requirements.txt
file.
-
Clone the repository:
git clone https://github.com/yourusername/binance-telegram-bot.git cd binance-telegram-bot
-
Create a virtual environment and activate it:
python -m venv env source env/Scripts/activate # On Windows # source env/bin/activate # On Unix or MacOS
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory and add your Telegram API key:TELEGRAM_API_KEY=your_telegram_api_key
Run the bot:
python main.py
main.py
: The main script to run the Telegram bot.functions/
: Directory containing helper functions and API calls.binance_api.py
: Functions to interact with the Binance API.markdown_telegram.py
: Functions to escape markdown characters.math_functions.py
: Functions to perform mathematical calculations.telegram_commands.py
: Telegram bot command handlers.
dont forget to change
ADMINS_DICT = {
"your name": 66524162233,
}
This project is licensed under the MIT License.