A ruby interface to the Zulip API.
Add this line to your application's Gemfile:
gem 'zulip'
And then execute:
$ bundle
Or install it yourself as:
$ gem install zulip
You can obtain your Zulip API key, create bots, and manage bots all from your Zulip settings page.
Set your api key and email address by passing a block to your Zulip::Client instance:
client = Zulip::Client.new do |config|
config.email_address = "YOUR_EMAIL_ADDRESS"
config.api_key = "YOUR_API_KEY"
end
Send messages to a stream:
client.send_message("Hey", "I'm posting to zulip", "test-stream")
Send private messages to one or more users:
client.send_private_message("hey I heard you like the internet", "bob@the-internet.net", "alice@the-information-superhighway.org")
Stream messages:
client.stream_messages do |message|
# Do some work
end
Get your current subscriptions:
client.get_subscriptions
Subscribe to a stream, passing the stream name:
client.subscribe "food"
List users:
client.get_users
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Some areas that could use contributions:
- Error handling
- Add unsubscribing from a stream