Binding Telegram answer not working

Hello,
I have an issue with the answering method from the telegram binding.
Before updating to OH3.4 works fine.

Here my warning:

2023-01-07 13:24:20.852 [WARN ] [gram.internal.action.TelegramActions] - messageId not defined; action skipped.

my code:
Question: (The question is sent.)

val telegram = getActions("telegram","telegram:telegramBot:703145")
	
	if(null === telegram) 
	{
	   logInfo("telegram", "Actions in knx-LICHT not found, check thing ID")
       return
	}
	telegram.sendTelegramQuery(-123456789L, "Kessel ist an:\nSoll die Kessel Gruppe benachrichtigt werden?", "msg_Kessel", "Ja", "nein")

but the answer not be sent:

rule "Benachrichtigung Gruppe Kessel über Telegram"
when
    Item telegramReplyId received update msg_Kessel
then
	val telegram = getActions("telegram","telegram:telegramBot:703145")
	var message = ""
	if(null === telegram) 
	{
       logInfo("telegram", "Actions in knx-LICHT not found, check thing ID")
       return
	}
	if (telegramMessage.state.toString == "Ja")
	{
		sendCommand(msg_g_kessel,ON)
		message = "Die Benachrichtigung über Telegram (Gruppe Kessel) wurde eingeschaltet.\nState= " + msg_g_kessel.state.toString
	}
	else
	{
		sendCommand(msg_g_kessel,OFF)
		message = "Okay! Keine Benachrichtigung über Telegram.\nState= " + msg_g_kessel.state.toString
	}
	telegram.sendTelegramAnswer(telegramReplyId.state.toString, message)
	postUpdate(telegramReplyId,"NULL")

end

It is executed but otherwise it was so that the choices disappear. But this is not done anymore.

Maybe someone can give me a hint. If it is a bug or if something has changed in the binding that I have not seen.

Thanks

Hi,
i have the same issue…


rule "Frage"
when
    Item SteinelCAM_Motionevent changed to ON
then
    val telegramAction = getActions("telegram","telegram:telegramBot:b56f3b7499")
    telegramAction.sendTelegramQuery("Jemand war vor der Tür willst du das Video sehen?", "Reply_Telegram_Video", "Ja", "Nein")
end


rule "Antwort auf die Frage"
when
    Item Telegram_Reply_Id received update Reply_Telegram_Video
then
    val telegramAction = getActions("telegram","telegram:telegramBot:b56f3b7499")
    if (Telegram_received_BOT.state.toString == "Ja")
    {
        telegramAction.sendTelegramAnswer(Telegram_Reply_Id.state.toString, "Video wird verschickt")
        telegramAction.sendTelegramVideo("file:/var/lib/openhab/ipcamera/5590f48d61/hauseingang.mp4", "Video - Hauseingang")
    }

    else if (Telegram_received_BOT.state.toString == "Nein")
    {
        telegramAction.sendTelegramAnswer(Telegram_Reply_Id.state.toString, "Ok kein Video.")
    }
        else
{}


end

If i reply with “Ja” everythink is working only with “nein” but in both cases i get the Log.

2023-01-31 21:30:17.253 [WARN ] [gram.internal.action.TelegramActions] - messageId not defined; action skipped.

Has someone an idea?

Regards
Simon

Hi Tobias,

today everything is running as expected, how about you?

Regards
Simon

I have the same issue.

I did a workaround yesterday. I linked the Telegrambot_Query_Callback_Received channel.
Then I get the chatid, messageid and callbackid and answer like it’s explained in the telegram binding.

TelegramAction.sendTelegramAnswer(chatId, callbackId, messageId, message) 

Greets

1 Like

I have solved the problem as described by: Baschtlwaschtl :

telegram.sendTelegramAnswer(telegramChatId.state.toString, telegramReplyId.state.toString, message)

ITEMS:

//Telegram
	String telegramReplyId "Telegram Reply Id" 		{ channel = "telegram:telegramBot:703145:replyId" }
	String telegramMessage "Telegram last Massage" 	{ channel = "telegram:telegramBot:703145:lastMessageText" }
    String telegramChatId "Telegram Chat Id" 	    { channel = "telegram:telegramBot:703145:chatId" }

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.