Sha256: 6d1c1b29d612dbccfc0a11db20e87b3c58b4ff8c06f91319a09f473bd117ae6d

Contents?: true

Size: 332 Bytes

Versions: 14

Compression:

Stored size: 332 Bytes

Contents

#!/usr/bin/env ruby

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

14 entries across 14 versions & 2 rubygems

Version Path
blather-0.4.16 examples/echo.rb
blather-0.4.15 examples/echo.rb
shingara-blather-0.4.14 examples/echo.rb
blather-0.4.14 examples/echo.rb
blather-0.4.13 examples/echo.rb
blather-0.4.12 examples/echo.rb
blather-0.4.11 examples/echo.rb
blather-0.4.10 examples/echo.rb
shingara-blather-0.4.9 examples/echo.rb
shingara-blather-0.4.8 examples/echo.rb
blather-0.4.8 examples/echo.rb
blather-0.4.7 examples/echo.rb
blather-0.4.6 examples/echo.rb
blather-0.4.5 examples/echo.rb