Rework the send method and implement attachments and icons #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rather than bogging down the send() function, we now have nice chainable methods for setting the username, channel and icon. The send function is now used to send the composed message along with the text for the message.
You can now send attachments with messages, and change the icon used to either a Slack emoji or a URL.
Also implemented some unit testing. You can see them being run on Travis-CI: https://travis-ci.org/maknz/slack. I will add a build badge to the README once this is merged.
This isn't BC with 0.1.x, but since we follow semantic versioning, we can make breaking changes for minor versions up until the 1.0 release.
@willwashburn can you take a look at the README (and maybe try it out, if you want to) and let me know what you think (and whether it satisfies the use cases from your PR). If all is well, I'll merge this and tag a 0.2 release.