Permalink
Browse files

Just for dale..

  • Loading branch information...
1 parent 0691ab0 commit a782e1741d11a2221720068ebab29627d4472572 @raggi committed Nov 13, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 examples/greeter.bot
View
@@ -1,6 +1,16 @@
class Greeter
attr_accessor :client
+ def on_message(sender, content, event)
+ return if sender['name'] == 'bot'
+ case content
+ when /^@*bot:*\s+/
+ client.send_message "Hi #{sender['name']}!"
+ when /botsnack/
+ client.send_message "botsnack, nom nom"
+ end
+ end
+
def on_join(*users)
users.each do |user|
client.send_message "Welcome #{user['name']}, nice to see you!"

0 comments on commit a782e17

Please sign in to comment.