}
OkHttpClient.Builder prepareConnection = new OkHttpClient.Builder().connectTimeout(75, TimeUnit.SECONDS)
- .readTimeout(75, TimeUnit.SECONDS);
+ .writeTimeout(75, TimeUnit.SECONDS).readTimeout(75, TimeUnit.SECONDS);
String proxyHost = config.getProxyHost();
Integer proxyPort = config.getProxyPort();
update.callbackQuery().data());
}
}
- updateChannel(LASTMESSAGETEXT, lastMessageText != null ? new StringType(lastMessageText) : UnDefType.NULL);
+ updateChannel(CHATID, chatId != null ? new StringType(chatId.toString()) : UnDefType.NULL);
+ updateChannel(REPLYID, replyId != null ? new StringType(replyId) : UnDefType.NULL);
updateChannel(LASTMESSAGEURL, lastMessageURL != null ? new StringType(lastMessageURL) : UnDefType.NULL);
- updateChannel(LASTMESSAGEDATE, lastMessageDate != null
- ? new DateTimeType(
- ZonedDateTime.ofInstant(Instant.ofEpochSecond(lastMessageDate.intValue()), ZoneOffset.UTC))
- : UnDefType.NULL);
updateChannel(LASTMESSAGENAME, (lastMessageFirstName != null || lastMessageLastName != null)
? new StringType((lastMessageFirstName != null ? lastMessageFirstName + " " : "")
+ (lastMessageLastName != null ? lastMessageLastName : ""))
: UnDefType.NULL);
updateChannel(LASTMESSAGEUSERNAME,
lastMessageUsername != null ? new StringType(lastMessageUsername) : UnDefType.NULL);
- updateChannel(CHATID, chatId != null ? new StringType(chatId.toString()) : UnDefType.NULL);
- updateChannel(REPLYID, replyId != null ? new StringType(replyId) : UnDefType.NULL);
+ updateChannel(LASTMESSAGETEXT, lastMessageText != null ? new StringType(lastMessageText) : UnDefType.NULL);
+ updateChannel(LASTMESSAGEDATE, lastMessageDate != null
+ ? new DateTimeType(
+ ZonedDateTime.ofInstant(Instant.ofEpochSecond(lastMessageDate.intValue()), ZoneOffset.UTC))
+ : UnDefType.NULL);
}
return UpdatesListener.CONFIRMED_UPDATES_ALL;
}
}
}
Integer messageId = localHandler.removeMessageId(chatId, replyId);
+ if (messageId == null) {
+ logger.warn("messageId could not be found for chatId {} and replyId {}", chatId, replyId);
+ return false;
+ }
logger.debug("remove messageId {} for chatId {} and replyId {}", messageId, chatId, replyId);
EditMessageReplyMarkup editReplyMarkup = new EditMessageReplyMarkup(chatId, messageId.intValue())
logger.warn("replyId {} must not contain spaces. ReplyMarkup will be ignored.", replyId);
}
}
- SendResponse retMessage = localHandler.execute(sendMessage);
+ SendResponse retMessage = null;
+ try {
+ retMessage = localHandler.execute(sendMessage);
+ } catch (Exception e) {
+ logger.warn("Exception occured whilst sending message:{}", e.getMessage());
+ }
if (!evaluateResponse(retMessage)) {
return false;
}