Sha256: 95ac32b58242e79f6d7978ecec1bc453e09ecdd1d3a374cb689265da37873fcf

Contents?: true

Size: 351 Bytes

Versions: 1

Compression:

Stored size: 351 Bytes

Contents

class MessageLog < Linkbot::Plugin
  Linkbot::Plugin.register('log', self,
    {
      :message => {:handler => :on_message}
    }
  )
  
  def self.on_message(message, matches)
    # Pop off a message if we've reached our max
    if @@message_log.length >= 100
      @@message_log.pop
    end
    
    @@message_log.unshift(message)
    ""
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
protolink-0.2.8 example/linkbot/plugins/log.rb