Sha256: 48648bf77b7c93ac4d1e1f8e693cacc50294bd7c7cc47bee5503e2e263e782ab

Contents?: true

Size: 322 Bytes

Versions: 19

Compression:

Stored size: 322 Bytes

Contents

#!/usr/bin/env ruby

require 'blather/client'

when_ready { puts "Connected ! send messages to #{jid.stripped}." }

subscription :request? do |s|
  write s.approve!
end

message :chat?, :body => 'exit' do |m|
  say m.from, 'Exiting ...'
  shutdown
end

message :chat?, :body do |m|
  say m.from, "You sent: #{m.body}"
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
sprsquish-blather-0.2.3 examples/echo.rb
sprsquish-blather-0.3.0 examples/echo.rb
sprsquish-blather-0.3.1 examples/echo.rb
sprsquish-blather-0.3.2 examples/echo.rb
sprsquish-blather-0.3.3 examples/echo.rb
sprsquish-blather-0.3.4 examples/echo.rb
sprsquish-blather-0.4.2 examples/echo.rb
sprsquish-blather-0.4.3 examples/echo.rb
sprsquish-blather-0.4.4 examples/echo.rb
blather-0.4.4 examples/echo.rb
blather-0.4.3 examples/echo.rb
blather-0.2.2 examples/echo.rb
blather-0.2.3 examples/echo.rb
blather-0.3.1 examples/echo.rb
blather-0.3.0 examples/echo.rb
blather-0.3.2 examples/echo.rb
blather-0.3.4 examples/echo.rb
blather-0.3.3 examples/echo.rb
blather-0.4.2 examples/echo.rb