A simple and efficient Telegram bot built with Go that provides detailed weather information in Persian. The bot fetches real-time weather data based on the user's location using the Telegram Bot API and the OpenWeatherMap API.
- ๐ Location-Based: Gets weather data using the user's live location sent via Telegram.
- ๐ก๏ธ Detailed Info: Displays current temperature, "feels like" temperature, and humidity.
- โ๏ธ Persian Descriptions: Translates weather conditions (e.g., "clear sky", "rain") into user-friendly Persian.
- ๐ Location Display: Shows the city and country name for the provided coordinates.
- ๐ค User-Friendly Interface: Welcomes users with a clear message and an easy-to-use location button.
- ๐ก๏ธ Error Handling: Gracefully handles API errors and network issues with informative messages.
(You can add a screenshot or GIF of the bot in action here)
Follow these steps to set up and run the bot locally.
- Go (version 1.18 or newer)
- A Bot Token from Telegram's @BotFather
- An API Key from OpenWeatherMap
- Start a chat with @BotFather on Telegram.
- Send the
/newbotcommand. - Follow the instructions to choose a name and a username for your bot.
- BotFather will provide you with a unique token. Copy it.
- Sign up on the OpenWeatherMap website.
- Navigate to the "API keys" tab in your account dashboard.
- Generate a new API key and copy it.
- Note: It might take a few minutes for a new key to become active.
# Clone the repository
git clone https://github.com/YOUR_USERNAME/weather-telegram-bot.git
cd weather-telegram-bot
# Install necessary Go packages
go mod tidy
#Run the Bot
go run main.go
This is a solution for the Weather API Wrapper Service project on roadmap.sh.
Project URL: https://roadmap.sh/projects/weather-api-wrapper-service
After running the program, you can interact with the Telegram bot @SimpleMyWeatherBot to get real-time weather information.