AEMET Telegram Bot
This bot has been developed to find new PDF documents in AEMET web pages and send them to the relevant Telegram chats.
Usage
usage: ./aemet_tg_bot <command> [--bot-config=<config-path>]
commands:
help Print this help.
run --bot-config=<config-path> Start running the bot.
init --bot-config=<config-path> Initialise the registries by running the bot.
Only the error messages to admin chat, if
configured, will be sent.
Quickstart
Using Docker
This option requires having docker installed.
- Download the docker image
aemet_tg_bot
from the package section of this repository.
- Set up the bot configuration in the
./botConfig.json
file.
- Set up the necessary environment variables.
- (Optionally) Initialise the registries so already uploaded PDFs are not sent to the Telegram groups:
$ docker run --env-file ./env.list aemet_tg_bot
- Run the bot
$ docker run --env-file ./env.list aemet_tg_bot run --bot-config=./botConfig.json
Without Docker
This option requires having Go v1.22 installed.
- Clone this repository and cd into it:
$ git clone https://github.com/albertoCCz/aemet_tg_bot
$ cd aemet_tg_bot
- Download dependencies and build executable.
$ go build
- Set up the bot configuration in the
./botConfig.json
file. Leave blank the chatId fields and token field, these will be read from the environment variables.
- Set up the necessary environment variables.
- (Optionally) Initialise the registries so already uploaded PDFs are not sent to the Telegram groups:
$ aemet_tg_bot init --bot-config=./botConfig.json
- Run the bot
$ aemet_tg_bot run --bot-config=./botConfig.json