Class TelegramForwarderBot

java.lang.Object
io.github.yvasyliev.telegramforwarderbot.TelegramForwarderBot
All Implemented Interfaces:
org.telegram.telegrambots.longpolling.starter.SpringLongPollingBot

public class TelegramForwarderBot extends Object implements org.telegram.telegrambots.longpolling.starter.SpringLongPollingBot
Telegram bot that forwards messages and handles updates.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Initializes the bot by sending a message to the admin chat indicating that the bot is running.
    void
    Shuts down the bot by sending a shutdown message to the admin chat.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.telegram.telegrambots.longpolling.starter.SpringLongPollingBot

    getBotToken, getUpdatesConsumer
  • Constructor Details

    • TelegramForwarderBot

      public TelegramForwarderBot()
  • Method Details

    • init

      @PostConstruct public void init() throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Initializes the bot by sending a message to the admin chat indicating that the bot is running.
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException - if an error occurs while sending the message
    • shutdown

      @PreDestroy public void shutdown() throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Shuts down the bot by sending a shutdown message to the admin chat.
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException - if an error occurs while sending the shutdown message