lib/ruboty/handlers/snack.rb in ruboty-snack-0.2.0 vs lib/ruboty/handlers/snack.rb in ruboty-snack-0.2.1

- old
+ new

@@ -10,25 +10,41 @@ ๐ŸŽ‚ ๐Ÿฎ ๐Ÿฌ ๐Ÿญ ๐Ÿซ ๐Ÿฟ ๐Ÿฉ ๐Ÿช ๐Ÿ„ ) on( /ใŠ่…น(?<status>.+)/, + name: "feed", + description: "Gives you some snacks" + ) + + on( + /(harahe|ใฏใ‚‰ใธ|ใƒใƒฉใธ|๏พŠ๏พ—๏พ)/, name: "feed_snack", description: "Gives you some snacks" ) - def feed_snack(message) - oyatsu = + def feed(message) + esa = case message[:status] when /ใ™ใ„/, /็ฉบ/, /ใธใฃ/, /ๆธ›/, /ใ™ใ/, /ใƒšใ‚ณใƒšใ‚ณ/, /ใบใ“ใบใ“/ - OYATSU.sample + 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