Sha256: f006080f8d233d95cd559b5535cc1af13d78ae43e76402267e0d4ec0aaaf8dd1

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require "ruboty"

module Ruboty
  module Handlers
    class Snack < Base
      OYATSU = %w(
        ๐ŸŒฐ ๐Ÿ ๐ŸŽ ๐Ÿ ๐ŸŠ ๐Ÿ‹ ๐ŸŒ ๐Ÿ‰ ๐Ÿ‡ ๐Ÿ“ ๐Ÿˆ ๐Ÿ’ ๐Ÿ‘ ๐Ÿ ๐Ÿ…
        ๐Ÿ† ๐ŸŒฝ ๐Ÿ  ๐Ÿž ๐Ÿง€ ๐Ÿ— ๐Ÿ– ๐Ÿค ๐Ÿณ ๐ŸŸ ๐ŸŒญ ๐Ÿ• ๐Ÿ ๐ŸŒฎ ๐ŸŒฏ
        ๐Ÿœ ๐Ÿฒ ๐Ÿฅ ๐Ÿฃ ๐Ÿฑ ๐Ÿ› ๐Ÿ™ ๐Ÿš ๐Ÿ˜ ๐Ÿข ๐Ÿก ๐Ÿง ๐Ÿจ ๐Ÿฆ ๐Ÿฐ
        ๐ŸŽ‚ ๐Ÿฎ ๐Ÿฌ ๐Ÿญ ๐Ÿซ ๐Ÿฟ ๐Ÿฉ ๐Ÿช ๐Ÿ„
      )

      on(
        /ใŠ่…น(?<status>.+)/,
        name: "feed",
        description: "Gives you some snacks"
      )

      on(
        /(harahe|ใฏใ‚‰ใธ|ใƒใƒฉใธ|๏พŠ๏พ—๏พ|ใƒใƒฉใƒ˜)/,
        name: "feed_snack",
        description: "Gives you some snacks"
      )

      def feed(message)
        esa =
          case message[:status]
          when /ใ™ใ„/, /็ฉบ/, /ใธใฃ/, /ๆธ›/, /ใ™ใ/,
               /ใƒšใ‚ณใƒšใ‚ณ/, /ใบใ“ใบใ“/
            oyatsu
          when /็—›ใ„/, /ใ„ใŸใ„/
            "๐Ÿ’Š"
          when /ใ„ใฃใฑใ„/, /ใฑใ‚“ใฑใ‚“/, /ใƒ‘ใƒณใƒ‘ใƒณ/, /ใ/, /่‹ฆ/
            "โ˜•"
          end
        message.reply("ใค#{esa}")
      end

      def feed_snack(message)
        message.reply("ใค#{oyatsu}")
      end

      private

      def oyatsu
        OYATSU.sample
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruboty-snack-0.2.2 lib/ruboty/handlers/snack.rb