summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/games
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-07 01:02:13 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-07 01:02:13 +0200
commite00ea339ca3baaa9cfe74f6cec85c36e83307b61 (patch)
tree9f2515638d34e52dea99a63a1fc1d3ab970781c9 /data/rbot/plugins/games
parent0e8f24e9b72eaaacc830cd5265a92944f806f587 (diff)
+ use the message() delegate instead of listen() when possible
Diffstat (limited to 'data/rbot/plugins/games')
-rw-r--r--data/rbot/plugins/games/azgame.rb3
-rw-r--r--data/rbot/plugins/games/quiz.rb4
-rw-r--r--data/rbot/plugins/games/shiritori.rb3
-rw-r--r--data/rbot/plugins/games/wheelfortune.rb4
4 files changed, 5 insertions, 9 deletions
diff --git a/data/rbot/plugins/games/azgame.rb b/data/rbot/plugins/games/azgame.rb
index b1bb09e5..4f60278f 100644
--- a/data/rbot/plugins/games/azgame.rb
+++ b/data/rbot/plugins/games/azgame.rb
@@ -144,8 +144,7 @@ class AzGamePlugin < Plugin
@registry[:wordcache] = @wordcache
end
- def listen(m)
- return unless m.kind_of?(PrivMessage)
+ def message(m)
return if m.channel.nil? or m.address?
k = m.channel.downcase.to_s # to_sym?
return unless @games.key?(k)
diff --git a/data/rbot/plugins/games/quiz.rb b/data/rbot/plugins/games/quiz.rb
index 792b75ae..a9ceddaf 100644
--- a/data/rbot/plugins/games/quiz.rb
+++ b/data/rbot/plugins/games/quiz.rb
@@ -360,9 +360,7 @@ class QuizPlugin < Plugin
# Reimplemented from Plugin
#
- def listen( m )
- return unless m.kind_of?(PrivMessage)
-
+ def message(m)
chan = m.channel
return unless @quizzes.has_key?( chan )
q = @quizzes[chan]
diff --git a/data/rbot/plugins/games/shiritori.rb b/data/rbot/plugins/games/shiritori.rb
index 71016e54..84ee9620 100644
--- a/data/rbot/plugins/games/shiritori.rb
+++ b/data/rbot/plugins/games/shiritori.rb
@@ -453,8 +453,7 @@ class ShiritoriPlugin < Plugin
end
# all messages from a channel is sent to its shiritori game if any
- def listen(m)
- return unless m.kind_of?(PrivMessage)
+ def message(m)
return unless @games.has_key?(m.channel)
# send the message to the game in the channel to handle it
@games[m.channel].handle_message m
diff --git a/data/rbot/plugins/games/wheelfortune.rb b/data/rbot/plugins/games/wheelfortune.rb
index 37eb63b5..cc9a1446 100644
--- a/data/rbot/plugins/games/wheelfortune.rb
+++ b/data/rbot/plugins/games/wheelfortune.rb
@@ -506,8 +506,8 @@ class WheelOfFortune < Plugin
end
end
- def listen(m)
- return unless m.kind_of?(PrivMessage) and not m.address?
+ def message(m)
+ return if m.address?
ch = m.channel.irc_downcase(m.server.casemap).intern
return unless game = @games[ch]
return unless game.running?