Sha256: f9da0bc777d1211d42b940bf82865e06dd10c024b3236c797f045741bb269a19

Contents?: true

Size: 351 Bytes

Versions: 37

Compression:

Stored size: 351 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'blather/client'

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

subscription :request? do |s|
  write_to_stream 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

37 entries across 37 versions & 2 rubygems

Version Path
blather-0.8.0 examples/echo.rb
blather-0.7.1 examples/echo.rb
blather-0.7.0 examples/echo.rb
blather-0.6.2 examples/echo.rb
blather-0.6.1 examples/echo.rb
blather-0.6.0 examples/echo.rb
blather-0.5.12 examples/echo.rb
blather-0.5.11 examples/echo.rb
blather-0.5.10 examples/echo.rb
blather-0.5.9 examples/echo.rb
blather-0.5.8 examples/echo.rb
blather-0.5.7 examples/echo.rb
blather-0.5.6 examples/echo.rb
blather-0.5.4 examples/echo.rb
blather-0.5.3 examples/echo.rb
blather-0.5.2 examples/echo.rb
blather-0.5.0 examples/echo.rb