Interface TelegramBot
public interface TelegramBot
Represents the Telegram bot handled by the
TelegramIntegrationManager
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetChatTitle
(long chatID) Gets the title of the specified chat.static TelegramBot
Gets the bot's instance.int
getUsers()
Gets the amount of users in the Telegram group.void
load()
Loads the Telegram bot.void
sendMessage
(long chatID, String message) Sends a message to the specified chat.default void
sendMessage
(String message) CallssendMessage(long, String)
specifyingTelegramIntegrationManager.getChatID()
as the first argument.void
Updates the bot's current status.void
unload()
Unloads the Telegram bot.
-
Method Details
-
load
Loads the Telegram bot.- Throws:
Exception
- If something goes wrong
-
unload
void unload()Unloads the Telegram bot. -
getInstance
Gets the bot's instance.This method calls
TelegramIntegrationManager.getBot()
.- Returns:
- Bot's instance
-
sendMessage
Sends a message to the specified chat.- Parameters:
chatID
- Chat's IDmessage
- Message to send- See Also:
-
sendMessage
CallssendMessage(long, String)
specifyingTelegramIntegrationManager.getChatID()
as the first argument.- Parameters:
message
- Message to send- See Also:
-
getUsers
int getUsers()Gets the amount of users in the Telegram group.- Returns:
- Users' amount
-
getChatTitle
Gets the title of the specified chat.Will return
Utils.NOT_APPLICABLE
if it is invalid.- Parameters:
chatID
- Chat's ID- Returns:
- Chat's title
-
setStatus
Updates the bot's current status.- Parameters:
value
- Text to display- See Also:
-