Class: Cinch::Plugins::LastSeen
- Inherits:
-
Object
- Object
- Cinch::Plugins::LastSeen
- Includes:
- Cinch::Plugin
- Defined in:
- lib/cinch/plugins/last_seen.rb
Defined Under Namespace
Classes: LoggedMessage
Instance Method Summary collapse
- #check_nick(m, nick) ⇒ Object
-
#initialize(*args) ⇒ LastSeen
constructor
A new instance of LastSeen.
- #log_message(m) ⇒ Object
Constructor Details
#initialize(*args) ⇒ LastSeen
Returns a new instance of LastSeen.
12 13 14 15 |
# File 'lib/cinch/plugins/last_seen.rb', line 12 def initialize(*args) super @logged_messages = {} end |
Instance Method Details
#check_nick(m, nick) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/cinch/plugins/last_seen.rb', line 24 def check_nick(m, nick) = @logged_messages[nick] if m.reply "I've last seen #{nick} at #{.time} in #{.channel} saying: #{.}", true else m.reply "I haven't seen #{nick}, sorry.", true end end |
#log_message(m) ⇒ Object
18 19 20 21 |
# File 'lib/cinch/plugins/last_seen.rb', line 18 def (m) return unless log_channel?(m.channel) @logged_messages[m.user.nick] = LoggedMessage.new(m.user.nick, m.channel.to_s, m., Time.now) end |