Sha256: ce914c12b1cfbe76e05b027b88cded08e2b9677935d00bc09e6ee5761e39d5ca

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 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.3 lib/ruboty/handlers/snack.rb