Package my.uum.service.impl
Class MessagingServiceImpl
java.lang.Object
my.uum.service.impl.MessagingServiceImpl
- All Implemented Interfaces:
MessagingService
Implementation of the MessagingService interface for sending messages via Telegram.
-
Constructor Summary
ConstructorsConstructorDescriptionMessagingServiceImpl(org.telegram.telegrambots.bots.TelegramLongPollingBot bot) Constructor to initialize the MessagingServiceImpl with a Telegram bot. -
Method Summary
Modifier and TypeMethodDescriptionvoidsendMessage(String chatId, String text) Sends a text message to a specified chat.voidsendMessage(String chatId, org.telegram.telegrambots.meta.api.methods.send.SendMessage message) Sends a SendMessage object to a specified chat.
-
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
Sends a text message to a specified chat.- Specified by:
sendMessagein interfaceMessagingService- Parameters:
chatId- the ID of the chat to send the message totext- 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:
sendMessagein interfaceMessagingService- Parameters:
chatId- the ID of the chat to send the message tomessage- the SendMessage object to send
-