Sha256: 320ffd66c849f3b7fedfed665b5c08834540d2e3e1db2215ddc1f4c5dafc0c4c

Contents?: true

Size: 395 Bytes

Versions: 1

Compression:

Stored size: 395 Bytes

Contents

module Lita
  module Handlers
    # s/chatbot/chatbutt/
    class Butt < Handler
      # insert handler code here
      route(/^b(u*)tt/, :butt, help: { 'butt' => '(_)_)' })

      def butt(response)
        groups = response.matches.first
        width = groups.first.size

        response.reply "(#{'_' * width})#{'_' * width})"
      end

      Lita.register_handler(self)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lita-butt-0.1.0 lib/lita/handlers/butt.rb