iobroker-community-adapters/ioBroker.telegram

get messageID/chatID in response of sendto()

Closed this issue · 3 comments

I use the telegram adapter to send snapshots and videos of our surveillance cameras.
At camera event at first i send a snapshot, record a 30s video and than i edit the first message and replace snapshot with video to save the overview in the chat.

It is a bit laborious to handle the messageIDs in case of more than one user.

Is it possible, to get the messageID/chatID of the actual send message in the response objekt of sendTo?
What i want is something like this:

return new Promise((resolve) => {
        sendTo('telegram.0', {
            [...]
        }, (res) => resolve(res));
}

for (var i = 0; i < res.users; i++) {
        log(res.chatid[i])
        log(res.messageid[i]
}

Is it possible?

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions.
Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

stale commented

This issue has been automatically closed because of inactivity. Please open a new issue if still relevant and make sure to include all relevant details, logs and reproduction steps. Thank you for your contributions.
Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, Logs und Reproduktionsschritte enthalten sind. Vielen Dank für Eure Unterstützung.

Nothing happened for a long time on this, but it would be helpful for me as well.
I am sending many messages to myself via telegram. (coffee ready, vacuuming robot started/finished, ...). To clean up the chat history and put more focus on really relevant messages, I want to delete messages that do not need to stay permanently.
Reading the message id from telegram.0.communicate.botSendMessageId in the callback function of sentTo unfortunately is bringing wrong results too often. Especially when multiple messages are sent in a short amount of time. Getting the feedback of the actual message id in the callback function would be very helpful to get it working correctly.