Open alisson276 opened 7 years ago
Anyone?
It looks like we don't support Telegram in st2chatops
yet, according to https://github.com/StackStorm/st2chatops/blob/4547240069906c1ea5411068183fa22c434559f1/package.json#L8-L23
It might work, but none tested it.
For so simple code change you might open a PR in this repo. It looks like StackStorm API is expecting a string for a channel, so type casting int to string should be safe and won't break other chat providers.
I can confirm that this works!
I've noticed an issue where special characters cause an error when interacting with telegram.
May 22 11:15:48 st2 hubot[24381]: [Wed May 22 2019 11:15:48 GMT+0000 (Coordinated Universal Time)] DEBUG Message length: 727
May 22 11:15:48 st2 hubot[24381]: [Wed May 22 2019 11:15:48 GMT+0000 (Coordinated Universal Time)] DEBUG Message parts: 1
May 22 11:15:49 st2 hubot[24381]: [Wed May 22 2019 11:15:49 GMT+0000 (Coordinated Universal Time)] ERROR Error: Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 400
May 22 11:15:49 st2 hubot[24381]: at Function.TelegramBot.error (/opt/stackstorm/chatops/node_modules/telegrambot/lib/telegrambot.js:26:15)
May 22 11:15:49 st2 hubot[24381]: at Request._callback (/opt/stackstorm/chatops/node_modules/telegrambot/lib/telegrambot.js:47:66)
May 22 11:15:49 st2 hubot[24381]: at Request.self.callback (/opt/stackstorm/chatops/node_modules/request/request.js:186:22)
May 22 11:15:49 st2 hubot[24381]: at Request.emit (events.js:189:13)
May 22 11:15:49 st2 hubot[24381]: at Request.<anonymous> (/opt/stackstorm/chatops/node_modules/request/request.js:1163:10)
May 22 11:15:49 st2 hubot[24381]: at Request.emit (events.js:189:13)
May 22 11:15:49 st2 hubot[24381]: at IncomingMessage.<anonymous> (/opt/stackstorm/chatops/node_modules/request/request.js:1085:12)
May 22 11:15:49 st2 hubot[24381]: at Object.onceWrapper (events.js:277:13)
May 22 11:15:49 st2 hubot[24381]: at IncomingMessage.emit (events.js:194:15)
May 22 11:15:49 st2 hubot[24381]: at endReadableNT (_stream_readable.js:1125:12)
May 22 11:15:49 st2 hubot[24381]: at process._tickCallback (internal/process/next_tick.js:63:19)
I think if we can fix this it will go a long way towards telegram support
Update:
The problem seems to be coming from the hubot-telegram
package
If the source_channel is not a String, like Telegram, the POST in /api/v1/aliasexecution fail with message:
My workarround is edit the file scripts/stackstorm.js and set: