Search in sources :

Example 11 with TelegramApiException

use of org.telegram.telegrambots.exceptions.TelegramApiException in project telegram-notifications-plugin by jenkinsci.

the class StartCommand method execute.

@Override
public void execute(AbsSender absSender, User user, Chat chat, String[] strings) {
    SendMessage answer = new SendMessage();
    answer.setChatId(chat.getId().toString());
    answer.setText(botStrings.get("message.help"));
    try {
        absSender.execute(answer);
    } catch (TelegramApiException e) {
        BotLogger.error(LOG_TAG, e);
    }
}
Also used : TelegramApiException(org.telegram.telegrambots.exceptions.TelegramApiException) SendMessage(org.telegram.telegrambots.api.methods.send.SendMessage)

Aggregations

TelegramApiException (org.telegram.telegrambots.exceptions.TelegramApiException)11 SendMessage (org.telegram.telegrambots.api.methods.send.SendMessage)6 URI (java.net.URI)4 Message (org.telegram.telegrambots.api.objects.Message)4 TelegramBotContextWrapper (won.bot.framework.bot.context.TelegramBotContextWrapper)4 EventListenerContext (won.bot.framework.eventbot.EventListenerContext)4 WonURI (won.bot.framework.eventbot.action.impl.mail.model.WonURI)4 Subscribers (jenkinsci.plugins.telegrambot.users.Subscribers)3 WonMessage (won.protocol.message.WonMessage)3 Connection (won.protocol.model.Connection)2 InvalidParameterException (java.security.InvalidParameterException)1 Dataset (org.apache.jena.query.Dataset)1 BotSession (org.telegram.telegrambots.generics.BotSession)1 Event (won.bot.framework.eventbot.event.Event)1 TelegramCreateNeedEvent (won.bot.framework.eventbot.event.impl.telegram.TelegramCreateNeedEvent)1 ConnectFromOtherNeedEvent (won.bot.framework.eventbot.event.impl.wonmessage.ConnectFromOtherNeedEvent)1 FailureResponseEvent (won.bot.framework.eventbot.event.impl.wonmessage.FailureResponseEvent)1 HintFromMatcherEvent (won.bot.framework.eventbot.event.impl.wonmessage.HintFromMatcherEvent)1 MessageFromOtherNeedEvent (won.bot.framework.eventbot.event.impl.wonmessage.MessageFromOtherNeedEvent)1 EventListener (won.bot.framework.eventbot.listener.EventListener)1