Sha256: 76680d208d6f746617cbae1350534d727143bc834c3527f7a02facea6305e5a9

Contents?: true

Size: 507 Bytes

Versions: 1

Compression:

Stored size: 507 Bytes

Contents

require 'artii'

module Lita
  module Handlers
    class AsciiArt < Handler
      route(/^ascii\s+(.*)/i, :ascii_from_text, command: true,
            help: { t('help.ascii_key') => t('help.ascii_value') })

      @@art = Artii::Base.new font: 'standard'

      def ascii_from_text(response)
        message = response.matches.first.map { |x| @@art.asciify(x) }.join
        response.reply render_template('lita-ascii-art', message: message)
      end
    end

    Lita.register_handler(AsciiArt)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lita-ascii-art-0.1.0 lib/lita/handlers/ascii_art.rb