diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/core/basics.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/rbot/core/basics.rb b/lib/rbot/core/basics.rb index 38c96b23..5c5bcdee 100644 --- a/lib/rbot/core/basics.rb +++ b/lib/rbot/core/basics.rb @@ -6,10 +6,15 @@ class BasicsModule < CoreBotModule def listen(m)
return unless m.kind_of?(PrivMessage)
- if(m.private? && m.message =~ /^\001PING\s+(.+)\001/)
- @bot.notice m.sourcenick, "\001PING #$1\001"
- @bot.irclog "@ #{m.sourcenick} pinged me"
- return
+ if m.message =~ /^\001PING\s+(.+)\001/
+ ping_id = $1
+ if m.private?
+ @bot.notice m.source, "\001PING #{ping_id}\001"
+ @bot.irclog "@ #{m.source} pinged me"
+ else
+ @bot.notice m.source, "\001PING #{ping_id}\001"
+ @bot.irclog "@ #{m.source} pinged #{m.target}"
+ end
end
end
|