Class TelegramService
java.lang.Object
es.urjc.etsii.grafo.events.AbstractEventListener
es.urjc.etsii.grafo.services.messaging.TelegramService
This class create a Bot for Mork framework.
Particularly, this bot will be generally used to send the following message when the experiment ends:
Experiment {{experimentName}} ended. Execution time: {{time}} seconds
-
Constructor Summary
ConstructorsConstructorDescriptionTelegramService
(TelegramConfig telegramConfig) Creates a TelegramLongPollingCommandBot using default options Use ICommandRegistry's methods on this bot to register commands -
Method Summary
Modifier and TypeMethodDescriptionboolean
ready()
Check if the telegram bot is workingvoid
sendMessage
(String message) Method for creating a message and sending it.void
stop()
Method for stopping a telegram bot
-
Constructor Details
-
TelegramService
Creates a TelegramLongPollingCommandBot using default options Use ICommandRegistry's methods on this bot to register commands- Parameters:
telegramConfig
- aTelegramConfig
object.
-
-
Method Details
-
ready
public boolean ready()Check if the telegram bot is working- Returns:
- true if the bot is working, false in other case
-
sendMessage
Method for creating a message and sending it.- Parameters:
message
- message
-
stop
public void stop()Method for stopping a telegram bot
-