windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
256 stars 116 forks source link

how to delete multiple messages? #285

Closed RootShell-coder closed 1 year ago

RootShell-coder commented 1 year ago

I tried to pass an array and it didn't work.

const deleteMessage = { 
    "type": "deleteMessage", 
    "chatId": 32332233, 
    "content": [ 1218, 1219, 1217 ]
}
msg.payload = deleteMessage
return msg

return error 400

Caught exception in sender node:
Error: ETELEGRAM: 400 Bad Request: message identifier is not specified
when processing message: 
{"_msgid":"9e987____88","payload":{"type":"deleteMessage","chatId":32332233,"content": [ 1218, 1219, 1217 ]"options":{}},"topic":""}
windkh commented 1 year ago

Hm I guess you can only delete the messages one by one right now.

windkh commented 1 year ago

use a for loop over the messageIds and then instead of return msg use node.send(msg)