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