This Project is a Student Project for the course "Computer Networks" at Hanyang University, Seoul, South Korea.
It is a Telegram bot that fetches Ethereum gas price data from the Etherscan API and sends it to a user via Telegram every 2 minutes.
- Fetch Ethereum gas prices every 2 minutes using the Etherscan API.
- Send the Fast Gas Price and First Gas Used Ratio to a user.
- Ability to reset change tracking with the
/restart
command.
- Python 3.9 (The version I used) or higher
- A Telegram bot token from BotFather.
- An API key from Etherscan.
- Clone the repository:
git clone https://github.com/TheHardy04/ChatBot-GasTrackerTelegram.git cd my-telegram-gas-tracker
- Install the required Python packages:
pip install -r requirements.txt
- Set up the
config.py
file:# Constants for API and Telegram bot API_KEY = "Your Etherscan API Key" TELEGRAM_TOKEN = "Your Telegram Bot Token" CHAT_ID = "Your Chat Id" # to find ChatID https://api.telegram.org/bot<YourBOTToken>/getUpdates TIME_INTERVAL = 120 # Time interval for sending updates (in seconds)
You only have to run this command
python main.py
- The bot will send a report to your telegram every 2 minutes
- To reset the tracking of the change, use the
/restart
command.