Search in sources :

Example 11 with SendMessage

use of com.pengrad.telegrambot.request.SendMessage 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 12 with SendMessage

use of com.pengrad.telegrambot.request.SendMessage in project anton-pavlovich-bot by wyvie.

the class WeatherComand method sendMessage.

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

Example 13 with SendMessage

use of com.pengrad.telegrambot.request.SendMessage 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)13 SendResponse (com.pengrad.telegrambot.response.SendResponse)4 Message (com.pengrad.telegrambot.model.Message)3 Chat (com.pengrad.telegrambot.model.Chat)2 TelegramBot (com.pengrad.telegrambot.TelegramBot)1 Update (com.pengrad.telegrambot.model.Update)1 User (com.pengrad.telegrambot.model.User)1 Keyboard (com.pengrad.telegrambot.model.request.Keyboard)1 ReplyKeyboardRemove (com.pengrad.telegrambot.model.request.ReplyKeyboardRemove)1 Optional (java.util.Optional)1 ByteString (okio.ByteString)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)1 Restaurant (org.wyvie.chehov.bot.commands.dailymenu.restaurant.Restaurant)1