Go to file
Francesco Esposito 1fa4231e09 edit readme 2022-01-31 16:45:07 +01:00
src Update && add Dockerfile 2022-01-31 16:19:33 +01:00
.env.sample Update && add Dockerfile 2022-01-31 16:19:33 +01:00
.gitignore
Dockerfile Update && add Dockerfile 2022-01-31 16:19:33 +01:00
LICENSE
README.md edit readme 2022-01-31 16:45:07 +01:00
docker-compose.yml Update && add Dockerfile 2022-01-31 16:19:33 +01:00
package-lock.json Update && add Dockerfile 2022-01-31 16:19:33 +01:00
package.json Update && add Dockerfile 2022-01-31 16:19:33 +01:00
test-publish.js Edit readme 2022-01-31 16:42:21 +01:00

README.md

NotificamBot

Telegram bot to receive notifications reads from a queue (pub/sub on Redis).

Configuration

Rename .env.sample in .env and configure it:

KEY DESCRIPTION
BOT_TOKEN Telegram Bot Token created with @BotFather
CHAT_ID Your chat id with the bot (you can configure this after the first launch of the bot from client)
REDIS_CHANELL Channel where the bot reads
REDIS_HOST Host redis (don't touch if you use docker-compose).
REDIS_PASSWORD Redis password

Usage

  1. Clone the project with
git clone https://github.com/franjsco/NotificamBot.git
  1. Build docker image and run it with docker-compose:
docker-compose up --build
  1. Search your bot on telegram and start it. The chat id will be displayed on the terminal. Copy it into .env and stop (CTRL+C) and start containers.
docker-compose up
  1. Now you can perform a test.
node test-publish.js
  1. You can send notifications to the bot by connecting to the container redis instance from any application and post messages to the configured queue.