Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now he greets whoever you say

  • Loading branch information...
commit 1ca5ddfde17e4ed08a07e5a06338b4f4f7c85bb2 1 parent 9f29988
@hemanth authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 rgbot.rb
View
6 rgbot.rb
@@ -77,6 +77,12 @@ def fortune(msg)
IO.popen("fortune") { |cmd| self.deliver(@msg,cmd.gets) }
end
+ def greet(msg)
+ if(!@msg.body.nil?)
+ self.deliver(@msg,"Hey "+@msg.body+" :)")
+ end
+ end
+
def main
while (true) do
@jabber.received_messages do |@msg|
Please sign in to comment.
Something went wrong with that request. Please try again.