Skip to content

A simple Telegram bot built with Go that provides current weather information based on a user's location.

Notifications You must be signed in to change notification settings

vasei-me/weather-bot-telegram-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒค๏ธ Telegram Weather Bot (Go)

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.

โœจ Features

  • ๐Ÿ“ 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.

๐Ÿ“ธ Preview

(You can add a screenshot or GIF of the bot in action here)

๐Ÿš€ Getting Started

Follow these steps to set up and run the bot locally.

1. Prerequisites

2. Get a Telegram Bot Token

  1. Start a chat with @BotFather on Telegram.
  2. Send the /newbot command.
  3. Follow the instructions to choose a name and a username for your bot.
  4. BotFather will provide you with a unique token. Copy it.

3. Get an OpenWeatherMap API Key

  1. Sign up on the OpenWeatherMap website.
  2. Navigate to the "API keys" tab in your account dashboard.
  3. Generate a new API key and copy it.
  4. Note: It might take a few minutes for a new key to become active.

4. Clone and Run the Project

# 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

Usage

After running the program, you can interact with the Telegram bot @SimpleMyWeatherBot to get real-time weather information.

About

A simple Telegram bot built with Go that provides current weather information based on a user's location.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages