Skip to content

FileGo/AvWxTelegramBot

Repository files navigation

AvWxTelegramBot

This projects creats a Telegram bot, written in Go that receives one or multiple airport identifiers (4-letter ICAO or 3-letter IATA), separated by comma or space and returns current (METAR) and forecasted weather (TAF) for the requested airports.

It uses NOAA Aviation Weather Center's Text Data Server to retrieve data. Requests require ICAO airport code. Default interval for METAR/TAF is 12 hours, but can be overriden by providing NOAA_INTERVAL environmental variable.

It also provides a JSON file (airports.json), which has been created with data from OpenFlights. It stores a large majority of worldwide airports and it is used to lookup ICAO and IATA codes as required.

In order to make use of Telegram, a bot needs to be created and token passed as an environmental variable. By default it uses the updates method of retrieving requests, however if both WEBHOOK_URL and WEBHOOK_PORT environmental variables are set, it will utilise the webhook.

CLI

Can be run as a CLI program:

$ TELEGRAM_TOKEN={insert Telegram bot token} ./AvWxTelegramBot

Docker

Easier way to run it is as a Docker container through docker-compose. An example of docker-compose.yml file:

---
version: "3.4"
services:
    avwxtelegrambot:
        container_name: avwxtelegrambot
        image: avwxtelegrambot:latest
        build: .
        environment: 
            - TELEGRAM_TOKEN=insert_telegram_bot_token
            - NOAA_INTERVAL=12                  # optional
            - WEBHOOK_URL=https://my.server.com # optional
            - WEBHOOK_PORT=443                  # optional
        restart: unless-stopped

Usage:

$ git clone https://github.com/FileGo/AvWxTelegramBot.git
$ cd AvWxTelegramBot
$ docker-compose up -d

Project makes use of the following libraries:

About

Telegram Bot for METAR/TAF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published