Sha256: ed2dc827c8f52270df4038f882e84cac7e995ec1e3bdda9a5b85bcc0cc9a36d3

Contents?: true

Size: 446 Bytes

Versions: 1

Compression:

Stored size: 446 Bytes

Contents

class Slap < Linkbot::Plugin
  Linkbot::Plugin.register('slapper', self,
    {
      :message => {:regex => /\/slap(?: (@[\w\s]+))?/, :handler => :on_message, :help => :help}
    }
  )
  
  def self.on_message(message, matches)
    "#{message.user_name} slaps #{matches[0]} around a bit with a large trout"
  end
  
  def self.help
    "/slap [username] - Flashback to the halcyon days of the 1990s when hammer pants were all the rage"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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