Sha256: 2e58839dd92647b2ca187f9b113347e8ec20627c30a0f65b04af70cf34590a55

Contents?: true

Size: 246 Bytes

Versions: 24

Compression:

Stored size: 246 Bytes

Contents

#!/usr/bin/env ruby

require 'blather/client'

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

message :chat?, :body do |m|
  begin
    say m.from, eval(m.body)
  rescue => e
    say m.from, e.inspect
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
sprsquish-blather-0.4.0 examples/execute.rb
sprsquish-blather-0.4.1 examples/execute.rb
sprsquish-blather-0.4.2 examples/execute.rb
sprsquish-blather-0.4.3 examples/execute.rb
sprsquish-blather-0.4.4 examples/execute.rb
blather-0.4.16 examples/execute.rb
blather-0.4.15 examples/execute.rb
shingara-blather-0.4.14 examples/execute.rb
blather-0.4.14 examples/execute.rb
blather-0.4.13 examples/execute.rb
blather-0.4.12 examples/execute.rb
blather-0.4.11 examples/execute.rb
blather-0.4.10 examples/execute.rb
shingara-blather-0.4.9 examples/execute.rb
shingara-blather-0.4.8 examples/execute.rb
blather-0.4.8 examples/execute.rb
blather-0.4.7 examples/execute.rb
blather-0.4.6 examples/execute.rb
blather-0.4.5 examples/execute.rb
blather-0.4.4 examples/execute.rb