Skip to content

Instantly share code, notes, and snippets.

@somebody32
Created September 17, 2009 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somebody32/188395 to your computer and use it in GitHub Desktop.
Save somebody32/188395 to your computer and use it in GitHub Desktop.
require "rubygems"
require "blather/client"
setup "some@thing.here", "password"
@translations = YAML.load(File.read(File.dirname(__FILE__)+"/translations.yml"))
before (:message, :chat?, :body) {|msg| puts "new message from #{msg.from.stripped}"}
message :chat?, :body => @translations["exit"].values do |m|
say m.from, "Exiting"
shutdown
end
message :chat?, :body do |m|
say m.from, "Your message is #{m.body}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment