IranWeather_Bot is a Telegram bot built with Golang that provides weather forecasts for cities in Iran. It fetches real-time weather data using the OpenWeatherMap API.
- Provides weather forecasts for 349 cities across Iran.
- Users can:
- Select cities from a predefined list at the start.
- Type a city's name to get a forecast.
- Delivers weather forecasts for three hours ahead, including:
- Temperature
- Humidity percentage
- Wind speed
- Weather description (e.g., partly cloudy) in English.
- Ready for upgrade to support 5-day forecasts.
- At the start, the bot offers a menu with a few cities to choose from.
- Users can also type the name of a city directly.
- The bot uses pre-stored latitude and longitude coordinates for 349 cities to fetch accurate data.
- Golang installed on your system.
- An OpenWeatherMap API key.
- Clone the repository:
git clone https://github.com/SaeedSH02/IranWeather_Bot.git cd IranWeather_Bot - Install dependencies:
go mod tidy
- Add your OpenWeatherMap API key to the configuration file (e.g.,
config.goor an environment variable). - Run the bot:
go run main.go
/start: Display a list of cities to choose from.- Type a city's name: Get the three-hour weather forecast for the city.
- Preloaded coordinates for 349 cities in Iran are included in the bot.
- Retrieves:
- Temperature
- Humidity percentage
- Wind speed
- Weather description in English.
- Expand forecast capabilities to provide 5-day weather predictions.
- Add support for additional commands or city search features.
Contributions are welcome! Feel free to fork the repo, make your changes, and submit a pull request.
This project is licensed under the MIT License.