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-2.0.0 examples/echo.rb
blather-1.2.0 examples/echo.rb
blather-1.1.4 examples/echo.rb
blather-1.1.3 examples/echo.rb
blather-1.1.2 examples/echo.rb
blather-1.1.1 examples/echo.rb
blather-1.1.0 examples/echo.rb
blather-1.0.0 examples/echo.rb
blather-0.8.8 examples/echo.rb
blather-0.8.7 examples/echo.rb
blather-0.8.6 examples/echo.rb
blather-0.8.5 examples/echo.rb
blather-0.8.4 examples/echo.rb
blather-0.8.3 examples/echo.rb
blather-0.8.2 examples/echo.rb
tp-blather-0.8.5 examples/echo.rb
tp-blather-0.8.4 examples/echo.rb
tp-blather-0.8.3 examples/echo.rb
tp-blather-0.8.2 examples/echo.rb
blather-0.8.1 examples/echo.rb