Skip to content

Weather bot for Telegram Messenger

License

Notifications You must be signed in to change notification settings

mlad/weather-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Bot

Weather bot for Telegram Messenger with multiple APIs and bookmarks support.

Bot UI preview

Features

  • Multiple APIs support:
  • Different report types:
    • Daily forecast
    • Current weather and hourly forecast
    • Hourly forecast on different heights (10m, 80m, 120m and 180m)
  • Weather by location (using built-in Telegram location sharing)
  • Text location search (using Open Meteo Geocoding API)
  • Beaufort Scale wind level display
  • Per-user bookmarks
  • Per-user quotas on API requests
  • Multiple languages support. Currently translated to:
    • English
    • Russian
  • API responses caching

Usage

  1. Install .NET 8 SDK for your platform
  2. Download the latest release or build it yourself, unpack the archive
  3. Run WeatherBot (Linux) or WeatherBot.exe (Windows), the app will create configuration.json file and exit
  4. Open created configuration file and fill the following properties:
    • TelegramBotToken with a Telegram bot API token (can be obtained from @BotFather bot)
    • OpenWeatherMap:ApiToken with Open Weather Map API token (register here), or completely remove OpenWeatherMap section
  5. Run the application again. If authorization is successful, console will display "Logged-in as {bot name}"
  6. Send /start or /help to the bot to get list of commands. Share a location to get weather

Building

  1. Install .NET 8 SDK for your platform
  2. In project directory, run dotnet publish ./WeatherBot/WeatherBot.csproj
  3. Binaries will be located in ./WeatherBot/bin/Release/net8.0/publish

Libraries used