I think, I stumbled about a bug in the Telegram binding (openHAB 3.2.0.M1). I’ll open a bug report but want to get your opinion on this before, maybe there is a solution I’m not aware of.
Discussed this here, [Telegram] sendTelegramAnswer works but error in log file 'null in xxx' - #17 by cybermcm, short summary:
Telegram bot working, thing config with 2 ChatIDs (personal and group chat).
I want to use the sendTelegramAnswer
function.
Snipped:
getActions("telegram","telegram:telegramBot:BOT").sendTelegramQuery(12345678L, "Test question?", "ReplyTest", "Yes", "No")
rule "test rule"
when
Item TelegramBot_ReplyId received update ReplyTest
then
if (TelegramBot_LastMessageText.state.toString == "Yes") {
getActions("telegram","telegram:telegramBot:BOT").sendTelegramAnswer(TelegramBot_ReplyId.state.toString, "Test No")
}
end
rule stopped with a WARN:
2021-09-05 22:16:16.082 [DEBUG] [gram.internal.action.TelegramActions] - AnswerCallbackQuery for chatId 12345678 and replyId ReplyTest is the callbackId 76676868130867550
2021-09-05 22:16:16.133 [DEBUG] [gram.internal.action.TelegramActions] - remove messageId 126 for chatId 12345678 and replyId ReplyTest
2021-09-05 22:16:16.318 [DEBUG] [gram.internal.action.TelegramActions] - AnswerCallbackQuery for chatId -123456789012 and replyId ReplyTest is the callbackId 11222334455667788
2021-09-05 22:16:16.383 [WARN ] [gram.internal.action.TelegramActions] - Failed to send telegram message: Bad Request: query is too old and response timeout expired or query ID is invalid
The sendTelegramAnswer
tries to send the answer to both ChatIDs and not just the one which initiates the query.
If I alter the thing config and put just one ChatID in, all is working without an issue. As soon as 2 ChatIDs are present the error occurs (during my tests the rule stopped, now the rule continues to work and only a WARN is present in the log, don’t know exactly why).
Any ideas?