S-3PO
A protocol droid made by Cybot Galactica for Slack.
This gem parses, generates, and manupilates various Slack events and messages.
Requirements
- Ruby 2.0.0 <=
Usage
If you're creating integrations or bots for Slack, this may come useful. Install:
$ gem install s-3po
Then use:
require 's-3po'
Your bot would connect to Slack via RTM API. Then process events like this.
event = S3PO.parse_event(data_from_slack)
puts "#{event.type} : #{event.subtype}"
puts event.plain if event.
# => "@U123ABC: hello you!"
Generate a message to send to Slack.
json = S3PO. do |reply|
reply.channel = 'CABC123'
reply.plain = "@channel: what's up, ya all?"
end
puts json
# => {"type":"message","channel":"CABC123","text":"<!channel>: what's up, ya all?","id":0}
See YARD Doc for more info.
What's Next
- Provide feedback
- Expect more updates
- Random anniversary on May 4th