windkh / node-red-contrib-telegrambot

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

Group topics support ? #286

Closed proton555 closed 1 year ago

proton555 commented 1 year ago

Telegram, more than a month back, in Bot API 6.3 added support for Group topics. https://core.telegram.org/bots/api

They change a lot, the way group discussions happen on telegram https://t.me/telegram/209

Seems to be merged here https://github.com/yagop/node-telegram-bot-api/pull/1020

Can you add support of that? Thanks

image

windkh commented 1 year ago

Version 0.61.0 was released https://www.npmjs.com/package/node-telegram-bot-api

Will add this soon

windkh commented 1 year ago

@proton555 could you please test the new version? If you could provide an example I would add it to the examples folder.

bonuzzz commented 1 year ago

@windkh seems the current version doesn't work with topic. This is my example:

[ { "id": "23a0bb59464c929d", "type": "tab", "label": "Flow 7", "disabled": false, "info": "", "env": [] }, { "id": "23c8d42ae031d6e9", "type": "function", "z": "23a0bb59464c929d", "name": "", "func": "msg.payload = \n{ \nchatId: -111,\nmessageThreadId: '1111',\ntype: 'message',\ncontent: \"1111\"\n};\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 480, "y": 260, "wires": [ [ "9e90b02ee4d5ba91" ] ] }, { "id": "9e90b02ee4d5ba91", "type": "telegram sender", "z": "23a0bb59464c929d", "name": "", "bot": "0ff6fb78493a7c42", "haserroroutput": false, "outputs": 1, "x": 720, "y": 260, "wires": [ [] ] }, { "id": "a4dc54826eca9f54", "type": "inject", "z": "23a0bb59464c929d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 280, "y": 260, "wires": [ [ "23c8d42ae031d6e9" ] ] }, { "id": "0ff6fb78493a7c43", "type": "telegram bot", "botname": "111_bot", "usernames": "", "chatids": "", "baseapiurl": "", "updatemode": "none", "pollinterval": "300", "usesocks": false, "sockshost": "", "socksprotocol": "socks5", "socksport": "6667", "socksusername": "anonymous", "sockspassword": "", "bothost": "", "botpath": "", "localbotport": "8443", "publicbotport": "8443", "privatekey": "", "certificate": "", "useselfsignedcertificate": false, "sslterminated": false, "verboselogging": false } ]

But it works with simple post http command: https://api.telegram.org/bot1111:111111/sendMessage?chat_id=-1111&text=test123&message_thread_id=111 message_thread_id added in array

windkh commented 1 year ago

@bonuzzz msg.payload.options = { message_thread_id: 14, };

https://github.com/windkh/node-red-contrib-telegrambot/blob/master/examples/sendtotopic.json

bonuzzz commented 1 year ago

It was so simple:) Thanks a lot!