lib/ruboty/handlers/snack.rb in ruboty-snack-0.1.0 vs lib/ruboty/handlers/snack.rb in ruboty-snack-0.2.0
- old
+ new
@@ -2,23 +2,33 @@
module Ruboty
module Handlers
class Snack < Base
OYATSU = %w(
- ๐ฐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐
+ ๐ฐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐
๐ ๐ฝ ๐ ๐ ๐ง ๐ ๐ ๐ค ๐ณ ๐ ๐ญ ๐ ๐ ๐ฎ ๐ฏ
๐ ๐ฒ ๐ฅ ๐ฃ ๐ฑ ๐ ๐ ๐ ๐ ๐ข ๐ก ๐ง ๐จ ๐ฆ ๐ฐ
๐ ๐ฎ ๐ฌ ๐ญ ๐ซ ๐ฟ ๐ฉ ๐ช ๐
)
on(
- /ใ่
นใใใ\z/i,
+ /ใ่
น(?<status>.+)/,
name: "feed_snack",
description: "Gives you some snacks"
)
def feed_snack(message)
- message.reply("ใค#{OYATSU.sample}")
+ oyatsu =
+ case message[:status]
+ when /ใใ/, /็ฉบ/, /ใธใฃ/, /ๆธ/, /ใใ/,
+ /ใใณใใณ/, /ใบใใบใ/
+ OYATSU.sample
+ when /็ใ/, /ใใใ/
+ "๐"
+ when /ใใฃใฑใ/, /ใฑใใฑใ/, /ใใณใใณ/, /ใ/, /่ฆ/
+ "โ"
+ end
+ message.reply("ใค#{oyatsu}")
end
end
end
end