Permalink
Browse files

Minor corrections

  • Loading branch information...
1 parent 372c24c commit 128789ff8da2eb9790517485075788e944e87a58 @raggi committed Nov 13, 2009
Showing with 2 additions and 3 deletions.
  1. +1 −1 examples/dice.bot
  2. +1 −2 examples/youtube.bot
View
@@ -3,7 +3,7 @@ class Dice
def on_message(sender, content, event)
return if sender['name'] == 'bot'
case content
- when /(\d+)[dD](\d+)(?:\+(\d+))/
+ when /(\d+)[dD](\d+)(?:\+(\d+))?/
results = Array.new($1.to_i){ 1+rand($2.to_i) }
total = results.inject { |t,v| t + v }
total += $3.to_i if $3
View
@@ -13,8 +13,7 @@ class YouTube
return if sender['name'] == 'bot'
case content
when /(.*) on youtube/
- @toobes.search(:query => $1)
- client.send_message "Hi #{sender['name']}!"
+ client.send_message @toobes.search(:query => $1).first.url
end
end
end

0 comments on commit 128789f

Please sign in to comment.