Class MessagingServiceImpl

java.lang.Object
my.uum.service.impl.MessagingServiceImpl
All Implemented Interfaces:
MessagingService

public class MessagingServiceImpl extends Object implements MessagingService
Implementation of the MessagingService interface for sending messages via Telegram.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MessagingServiceImpl(org.telegram.telegrambots.bots.TelegramLongPollingBot bot)
    Constructor to initialize the MessagingServiceImpl with a Telegram bot.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    sendMessage(String chatId, String text)
    Sends a text message to a specified chat.
    void
    sendMessage(String chatId, org.telegram.telegrambots.meta.api.methods.send.SendMessage message)
    Sends a SendMessage object to a specified chat.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MessagingServiceImpl

      public MessagingServiceImpl(org.telegram.telegrambots.bots.TelegramLongPollingBot bot)
      Constructor to initialize the MessagingServiceImpl with a Telegram bot.
      Parameters:
      bot - the Telegram bot to use for sending messages
  • Method Details

    • sendMessage

      public void sendMessage(String chatId, String text)
      Sends a text message to a specified chat.
      Specified by:
      sendMessage in interface MessagingService
      Parameters:
      chatId - the ID of the chat to send the message to
      text - the text of the message to send
    • sendMessage

      public void sendMessage(String chatId, org.telegram.telegrambots.meta.api.methods.send.SendMessage message)
      Sends a SendMessage object to a specified chat.
      Specified by:
      sendMessage in interface MessagingService
      Parameters:
      chatId - the ID of the chat to send the message to
      message - the SendMessage object to send