Search in sources :

Example 1 with SendResponse

use of com.pengrad.telegrambot.response.SendResponse in project anton-pavlovich-bot by wyvie.

the class SlovnikCommand method sendMessage.

private void sendMessage(long chatId, String messageText, ParseMode parseMode) {
    logger.debug("going to send message: " + messageText + " message size: " + messageText.length());
    SendMessage sendMessage = new SendMessage(chatId, messageText);
    if (parseMode != null) {
        sendMessage = sendMessage.parseMode(parseMode).disableWebPagePreview(true);
    }
    SendResponse response = telegramBot.execute(sendMessage);
}
Also used : SendResponse(com.pengrad.telegrambot.response.SendResponse) SendMessage(com.pengrad.telegrambot.request.SendMessage)

Example 2 with SendResponse

use of com.pengrad.telegrambot.response.SendResponse in project anton-pavlovich-bot by wyvie.

the class WikiCommand method sendMessage.

private void sendMessage(long chatId, String errorText) {
    SendMessage sendMessage = new SendMessage(chatId, errorText);
    SendResponse response = telegramBot.execute(sendMessage);
}
Also used : SendResponse(com.pengrad.telegrambot.response.SendResponse) SendMessage(com.pengrad.telegrambot.request.SendMessage)

Aggregations

SendMessage (com.pengrad.telegrambot.request.SendMessage)2 SendResponse (com.pengrad.telegrambot.response.SendResponse)2