Created
September 17, 2009 07:33
-
-
Save somebody32/188395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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