Sha256: 61e876f985e8a92b3f612d51a1d0b642ab8a58dccd43be8e9debb78c13582244

Contents?: true

Size: 265 Bytes

Versions: 37

Compression:

Stored size: 265 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
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

37 entries across 37 versions & 2 rubygems

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