Building AIWeatherBot: A Smart Telegram Weather Bot with Gemini API and Multi-Language Support

Have you ever wanted a weather bot that gives you more than just raw data?

Meet AIWeatherBot — a smart and open-source Telegram bot that combines real-time weather data with AI-powered analysis and multi-language support, built for an intuitive and helpful user experience.


🌦️ What is AIWeatherBot?

AIWeatherBot is a Telegram bot that provides:

  • Accurate weather forecasts for any city 🌍
  • AI-enhanced analysis of the weather report using the Gemini API by Google
  • Multi-language support (English and Persian 🇬🇧🇮🇷)
  • YAML-based localization for easy translation
  • City memory: user-specific saved city preferences
  • Both command-based and free-text input support (e.g., “Weather in Paris”)

This project is perfect for anyone interested in building smart bots, working with APIs, or learning about localization in bots.


🧠 Key Technologies Used

  • Python – Core logic using pyTelegramBotAPI
  • Gemini API (Google) – To interpret and generate human-friendly weather summaries
  • OpenWeatherMap API – For real-time weather data
  • YAML – For localization and multi-language configuration
  • GitHub Actions – For continuous integration and deployment

💡 Features Overview

📡 Real-Time Forecasts

The bot fetches real-time weather data using OpenWeatherMap API. It retrieves the temperature, condition, humidity, wind speed, etc.

🧠 AI-Powered Weather Analysis

Instead of sending raw JSON-like data, AIWeatherBot uses Gemini API to analyze the weather and generate simple, human-friendly explanations.

For example:

Weather in New York:

Image description

The AI doesn’t generate random replies — it only analyzes weather reports to provide more useful, conversational summaries.

🌍 Multi-language Support with YAML

The bot supports English and Persian, and adding more languages is simple with YAML files.

# en.yml
weather_report: "Weather in {{city}}: {{description}}, {{temp}}°C"
error_not_found: "Sorry, I couldn’t find that city."

# fa.yml
weather_report: "آب‌وهوا در {{city}}: {{description}}، {{temp}} درجه سانتی‌گراد"
error_not_found: "متأسفم، نتونستم این شهر رو پیدا کنم."

🏙️ City Memory

Users don’t need to type their city every time. The bot remembers each user’s last requested city and reuses it when they ask something like “/weather” or “weather today”.

🔧 How It Works

graph TD;
    User-->TelegramBot;
    TelegramBot-->WeatherAPI[OpenWeatherMap];
    TelegramBot-->AIEngine[Gemini API];
    TelegramBot-->Localization[YAML Files];
    WeatherAPI-->TelegramBot;
    AIEngine-->TelegramBot;

The bot processes the weather data, sends it to Gemini for analysis, and returns a clean response to the user in their preferred language.

🚀 Future Plans

  • 🐳 Docker version for easy deployment

  • 🌐 Support for more languages

  • 📆 3-day forecast support

  • 🧪 Unit tests for core logic

  • 📲 Telegram inline queries

📁 Source Code

Check out the full open-source code on GitHub:
👉 https://github.com/VimingOfficial/AIWeatherBot

Feel free to fork, star, or contribute to the project!

🙋‍♂️ About Me

I’m an 18-year-old computer engineering student passionate about AI, automation, and open-source development. This bot started as a simple idea but quickly grew into a project that helped me learn about:

  • API integration

  • AI prompt engineering

  • Localization

  • Telegram bot development

Let’s connect on GitHub → VimingOfficial

🤝 Contributions Welcome!

AIWeatherBot is open to contributions! Whether you're a beginner or an experienced developer, you can help improve this project.

Here are a few areas you can contribute to:

  • 🔤 Localization: Help us add support for more languages by translating YAML files.

  • 🧪 Testing: Write tests to ensure the bot’s stability and catch edge cases.

  • 🧠 Prompt Engineering: Improve how we interact with the Gemini API to generate even better weather explanations.

  • 🐳 Dockerization: Help create a clean, production-ready Dockerfile and deployment guide.

  • 🎨 UI/UX for a Future Web Dashboard (planned): If you’re into front-end dev, we’ll soon add a dashboard for bot analytics and admin controls.

  • 📈 Optimization: Suggest performance improvements, cleaner architecture, or refactoring ideas.

🛠️ Skills You’ll Use or Learn

If you want to learn and grow, this project can be a great opportunity to work with:

  • Python & Telegram bot development

  • RESTful APIs (OpenWeatherMap, Gemini)

  • AI prompt engineering

  • YAML-based localization

  • GitHub Actions & CI/CD workflows

  • Software design for scalable bots

📌 Getting Started

Fork the GitHub repo

Clone it and follow the README instructions

Start with an issue or suggest an improvement

Submit a PR — we’ll review it quickly!

💬 Let's Chat

Got a question? Want to contribute? Curious how Gemini API is integrated? Feel free to leave a comment or open an issue on GitHub. I'd love to hear your thoughts or help you build something similar!

Thanks for reading — and stay weather-smart! ☀️🌧️❄️