Skip to content

Instantly share code, notes, and snippets.

@tjmtmmnk
Created April 26, 2019 06:47
Show Gist options
  • Save tjmtmmnk/0a5efa343dc62e52e0042ffeb30c2f04 to your computer and use it in GitHub Desktop.
Save tjmtmmnk/0a5efa343dc62e52e0042ffeb30c2f04 to your computer and use it in GitHub Desktop.
# Description
# A Hubot script for omikuji
# Commands:
# omikuji <item1>,<item2>,<item3>
module.exports = (robot) ->
robot.hear /omikuji\s(.+)/, (msg) ->
items = msg.match[1].split(/[・、,,\s,]+/)
item = msg.random items
msg.send "#{item}さんお願いします!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment