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