/TelegramNotifierBot

Java 14, Spring Boot, Spring JPA, Maven, Postgres, Lombok, SLF4J, TelegramBots, TelegramBotsExtensions, Jackson.

Primary LanguageJava

Telegram Notifier Bot

Codacy Badge Hits Known Vulnerabilities


Bot is used by account managers and their heads in order to get information about overdue debts daily. Designed for internal use inside company.


PLEASE NOTE THAT THIS PROJECT WON'T COMPILE

Due to security restrictions this repository doesn't contain tokens. In order to run this bot:

  • add bot token and name to application.yaml (required minimum to compile the project and run bot);
  • add bot admin token to application.yaml (to get start up report and receive unauthorized messages);
  • make changes to services that use JSON data as those defined in this project are built in order to work with API given by the customer;
  • add slack webhook URL's to receive scheduled messages to designated slack channel.

Technology stack:

Java 14, TelegramBots API, TelegramBotsExtensions, Slack API, Spring Boot, Spring Data JPA, Hibernate, Lombok, Maven, Postgres, SLF4J, Jackson.


Features:

  • Bot is based on Long Polling Bot;
  • Separate profiles (war, test);
  • Authentication is based on green list of tokens stored in Postgres DB;
  • Role-based authorization;
  • Bot admin is notified if user calls command he is unauthorized to use;
  • Help message is generated dynamically (based on user roles);
  • Unauthorized users can get their token;
  • Authorized users can get information about upcoming birthdays;
  • Authorized users can get information about customer debts based on their role (manager, head);
  • Admins can get bot server time, notify all users, update users using chat commands;
  • Scheduling of individual notification time for each user;
  • Several levels of logging;
  • Bot is deployed to Heroku.

Screenshots:

Message about successful initialization:

ScreenShot

Unauthorized user available commands:

ScreenShot

Authorized user (employee) available commands:

ScreenShot

Authorized user (manager, head) available commands:

ScreenShot

Schedule management:

ScreenShot


Deployment

Deployment via Heroku CLI:

mvn clean heroku:deploy

Starting up:

heroku ps:scale worker=1 -a app_name

Retrieving logs:

heroku logs -a app_name