dyedurham / pockybot

A Webex Teams Bot that handles team recognition
GNU General Public License v3.0
7 stars 2 forks source link

Pockybot tries to handle its own messages #36

Closed Evangelinexx closed 5 years ago

Evangelinexx commented 5 years ago

When you send a direct message to the bot, it tries to then handle its own message in the direct message room.

Related logs:

2019-01-17T06:25:48.395Z DEBUG StagingBot 350.43-pr-master 1 "processing message: {\"id\":\"Y2lzY29zcGFyazovL3VzL01FU1NBR0UvYjdlNTNiYzAtMWEyMC0xMWU5LTk5YjEtZGJhZGM1YzgxMGJl\",\"roomId\":\"Y2lzY29zcGFyazovL3VzL1JPT00vZjE3NDA0YzYtNWNhYi0zZjFkLWI2OGItMjYwNjY4ZTFjZjkw\",\"roomType\":\"direct\",\"text\":\"\",\"files\":[\"https://api.ciscospark.com/v1/contents/Y2lzY29zcGFyazovL3VzL0NPTlRFTlQvYjdlNTNiYzAtMWEyMC0xMWU5LTk5YjEtZGJhZGM1YzgxMGJlLzA\"],\"personId\":\"Y2lzY29zcGFyazovL3VzL1BFT1BMRS84NDQyYzlhOC0zOWI1LTQzYWQtOWY5NS00ZmMwODVjNjU1MTQ\",\"personEmail\":\"evelyne.berger@globalx.com.au\",\"created\":\"2019-01-17T06:25:43.804Z\"}"
2019-01-17T06:25:48.396Z INFORMATION StagingBot 350.43-pr-master 1 "Found a direct trigger: Default"
2019-01-17T06:25:48.396Z INFORMATION StagingBot 350.43-pr-master 1 {"markdown":"## I'm sorry, I didn't understand that, here's what I can do:\n1. To give someone a peg type: `@StagingBot peg @bob {comment}`.\n1. For a full list of commands type `@StagingBot help`.\n\nI am still being worked on, so [more features to come : )] (https://github.com/Lauraducky/pockybot/issues)"}
2019-01-17T06:25:49.594Z DEBUG StagingBot 350.43-pr-master 1 {"id":"Y2lzY29zcGFyazovL3VzL01FU1NBR0UvYmI0MjIyNjAtMWEyMC0xMWU5LTg0ZjAtMTFkZDM5ZmI2NzNh","roomId":"Y2lzY29zcGFyazovL3VzL1JPT00vZjE3NDA0YzYtNWNhYi0zZjFkLWI2OGItMjYwNjY4ZTFjZjkw","roomType":"direct","text":"I'm sorry, I didn't understand that, here's what I can do: To give someone a peg type: @StagingBot peg @bob {comment}. For a full list of commands type @StagingBot help. I am still being worked on, so more features to come : )","personId":"Y2lzY29zcGFyazovL3VzL1BFT1BMRS8yMGY3ZGQzYy04M2VhLTRiYWYtOTk2NC1iYTg2NmE2YmIzMWM","personEmail":"StagingBot@webex.bot","markdown":"## I'm sorry, I didn't understand that, here's what I can do:\n1. To give someone a peg type: `@StagingBot peg @bob {comment}`.\n1. For a full list of commands type `@StagingBot help`.\n\nI am still being worked on, so [more features to come : )] (https://github.com/Lauraducky/pockybot/issues)","html":"<h2>I'm sorry, I didn't understand that, here's what I can do:</h2><ol><li>To give someone a peg type: <code>@StagingBot peg @bob {comment}</code>.</li><li>For a full list of commands type <code>@StagingBot help</code>.</li></ol><p>I am still being worked on, so <a href=\"https://github.com/Lauraducky/pockybot/issues\" rel=\"nofollow\">more features to come : )</a></p>","created":"2019-01-17T06:25:49.446Z"}
2019-01-17T06:25:50.708Z DEBUG StagingBot 350.43-pr-master 1 "processing message: {\"id\":\"Y2lzY29zcGFyazovL3VzL01FU1NBR0UvYmI0MjIyNjAtMWEyMC0xMWU5LTg0ZjAtMTFkZDM5ZmI2NzNh\",\"roomId\":\"Y2lzY29zcGFyazovL3VzL1JPT00vZjE3NDA0YzYtNWNhYi0zZjFkLWI2OGItMjYwNjY4ZTFjZjkw\",\"roomType\":\"direct\",\"text\":\"I'm sorry, I didn't understand that, here's what I can do: To give someone a peg type: @StagingBot peg @bob {comment}. For a full list of commands type @StagingBot help. I am still being worked on, so more features to come : )\",\"personId\":\"Y2lzY29zcGFyazovL3VzL1BFT1BMRS8yMGY3ZGQzYy04M2VhLTRiYWYtOTk2NC1iYTg2NmE2YmIzMWM\",\"personEmail\":\"StagingBot@webex.bot\",\"markdown\":\"## I'm sorry, I didn't understand that, here's what I can do:\\n1. To give someone a peg type: `@StagingBot peg @bob {comment}`.\\n1. For a full list of commands type `@StagingBot help`.\\n\\nI am still being worked on, so [more features to come : )] (https://github.com/Lauraducky/pockybot/issues)\",\"html\":\"<h2>I'm sorry, I didn't understand that, here's what I can do:</h2><ol><li>To give someone a peg type: <code>@StagingBot peg @bob {comment}</code>.</li><li>For a full list of commands type <code>@StagingBot help</code>.</li></ol><p>I am still being worked on, so <a href=\\\"https://github.com/Lauraducky/pockybot/issues\\\" rel=\\\"nofollow\\\">more features to come : )</a></p>\",\"created\":\"2019-01-17T06:25:49.446Z\"}"
Evangelinexx commented 5 years ago

It seems like we can't do something like personId!=pockyId when filtering messages in spark webhooks. Unless cisco decides to add this, this issue cannot be resolved.

arthurs commented 5 years ago

could you do something along the lines of, at the highest level of the trigger check if sender id is equal to bot id and discard the message if so? not as ideal as a filter on the webhook but should still be decent

Evangelinexx commented 5 years ago

It's already doing something like that to avoid an infinite loop, but I have no idea where.

Evangelinexx commented 5 years ago

I've contacted webex teams developer support to at least see if I can get it in their backlog to do the != filter thing.

Lauraducky commented 5 years ago

It's already doing something like that to avoid an infinite loop, but I have no idea where.

The code for this is currently in pm-responder.ts

Evangelinexx commented 5 years ago

image

Evangelinexx commented 5 years ago

image

gillianmilne commented 5 years ago

This is still on hold?

Evangelinexx commented 5 years ago

I never got a response from Cisco. Don't know if we should just close this.

Lauraducky commented 5 years ago

It's been months. Closing this for now and we can reopen if @Evangelinexx ever gets a response from Cisco