-
-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added FILE_SHARE subtype for incoming message, new event added #86
base: master
Are you sure you want to change the base?
Conversation
I will merge it in a day or two but by any chance is it possible for you to write a unit test for your changes? |
Hi Ram, thanks a lot, looking forward to it! Actually I don't know if it's possible to unit test my change -- I've added a new event type, so as I understand this should rather be tested by some integration test. And in this case it would involve quite a few more changes, because for now there is just one simple unit test and no integration test harness implemented. |
…-share-message # Conflicts: # jbot/src/main/java/me/ramswaroop/jbot/core/slack/Bot.java # jbot/src/test/java/me/ramswaroop/jbot/core/slack/EventTypeTest.java
Hi Ram, I've found some conflicts, so I pulled the changes from origin/master and resolved them. Then I've found a failed unit test which helped me to fix an empty subtype handilng. And also with its help I've managed to cover my new feature with the test. So, it seems like all set now. What do you think, can we merege the PR? |
Hey, Thanks for PR (and the unit test). Will review it and merge shortly. |
Hi Ram, Sorry to bother you, but is there anything I can do to help merge the PR? We're using this new functionality in a small pet project, and merging to master and build new release version would really ease the building process as I could just update JBot version then. Thanks a lot, |
Hi Fedor, I haven't merged this PR because there are many subtypes under message event type. So, I was thinking of including everything as events in Also, we need to modify |
+1 |
Hi there,
Been using JBot for recieving files sent to slack channel. Faced an issue with FILE_SHARED message, the File object I received was containing nulls for most of the fields.
Looked it up here: https://api.slack.com/tutorials/working-with-files. Turned out that "file_shared" event isn't what I needed to listen to and event "message" with subtype "file_share" is.
This way you'll get pretty populated File object (I needed urls for download) right away in the event. Otherwise all you could get is File ID and then have to make an additional request to Slack API for the url.
So all I've done was adding FILE_SHARE_MESSAGE event type as you can see to catch it properly. Hope it makes sense.
Thanks for the JBot,
Fedor